Question

  Asked: Apr 1 2008   8:37 AM GMT
  Asked by: LotusScript24


How to export Lotus Notes document to OpenOffice Writer document?


LotusScript, OpenOffice Writer, Export, Lotus Notes

Hi!
Idea is very simple, click on Action Button (code must be in LotusScript) when opened LN document, and then by clicking this Action Button all LN document data exports/converts/migrates on OpenOffice Writer document.
Can anyone know how to do that?
Tnx ;)

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



There's no built-in option to export to this format. You would need to find an OpenOffice API that you can call from LotusScript or Java, and make calls to that to build your document. I don't know whether such an API exists. You can export to some other format and open it using OpenOffice, however. Note that the export functions are not available from LotusScript -- @Command([FileExport]; ...) is what you need. I don't know why you are insisting that the action button must be LotusScript, but you can create actions that use a mix of languages by, for instance, calling a LS agent, then a macro agent, then a LS agent.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on Lotus Domino, Linux and DataManagement.

Looking for relevant Lotus Domino Whitepapers? Visit the SearchDomino.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

TS7578  |   May 13 2008  5:49PM GMT

There is an API to OpenOffice document.
You’ll find in the downloadable database that goes with this article the basis of the API:

<a href="http://drh02.eapps.com/eview/viewr6.nsf/e640f630a3361f84852568f600070fd3/d45c50d0566aa59a852572a5007376b0?OpenDocument&Highlight=0,openoffice" rel="nofollow">http://drh02.eapps.com/eview/viewr6.nsf/e640f630a3361f84852568f600070fd3/d45c50d0566aa59a852572a5007376b0?OpenDocument&Highlight=0,openoffice</a>

To create a nice looking write document with the content of Notes document I would create a writer model document including fields label, titles and so on. At the places where the Notes data must be output, create bookmarks, and gave the same name than the sourceNotes item.

Then use a function looking like this one to trigger the substitution:

Function setBookmarkValues(doc As NotesDocument) As Integer
Dim vRange As Variant, vBookmark As Variant , vCursor As Variant, vText As Variant
Dim sFldName As String, sBkName As String
Dim sVal As Variant
Dim ix As Integer
For ix = 0 To vBookmarks.count - 1
Set vBookmark = vBookmarks.getByIndex(ix)
sBkName = vBookmark.name
If Not Iselement(sUsedFields(sBkName)) Then
‘ si présence _ dans signet, éliminer partie droite à partir de _
If Instr(sBkName, “_”) > 0 Then
sFldName = Left$(sBkName, Instr(sBkName, “_”) -1)
Else
sFldName = sBkName
End If
If doc.hasItem(sFldName) Then
Set vText = vBookmark.Anchor.Text
Set vCursor = vText .createTextCursorByRange(vBookmark.Anchor)
sVal = doc.getItemValue(sFldName)(0)
If sVal <> “” Then
vCursor.String = sVal
sUsedFields(sBkName) = True
End If
End If
End If
Next
setBookmarkValues = vBookmarks.count
End Function

of cource there are many variables and initialisation code to have this code runs, but there is no enough place here to give enough details. Hope this will help you.