
TS7578 |
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.