Navigation:  DominoPDF > Sample Code >

DominoPDF - Attach PDFExample

Previous pageReturn to chapter overviewNext page

Once you have created your PDF output via DominoPDF you may wish to attach the PDF file to a Notes document. Attaching a file can be carried out via LotusScript and an example is below.

Dim session As New NotesSession

Dim db As NotesDatabase

Dim rdoc As NotesDocument

Dim rt As NotesRichTextItem

Dim object As NotesEmbeddedObject

 

Set db = session.CurrentDatabase

Set rdoc = db.createdocument

 

rdoc.form = "Memo"

 

Set rt = New NotesRichTextItem (rdoc , "Body" )

Call rt.addnewline(2)

Call rt.appendtext("Here's your attachment --> ")

 

Set object = rt.EmbedObject( EMBED_ATTACHMENT, "", "c:\test.pdf")

Call rt.addnewline(2)

 

Call rdoc.save(True)