Lotus Software logo
IBM Lotus Domino Designer 8.5
  Versions 8.5 and 8.5.1






Examples: EmbedObject method

  1. This script creates a new document in the current database, creates a new rich text item called Body on the document, and attaches the file JIM.SAM to the Body. It then sets the value of the Form and Subject items on the document and saves it.
  2. Dim session As New NotesSession
    
    Dim db As NotesDatabase
    Dim doc As NotesDocument
    Dim rtitem As NotesRichTextItem
    Dim object As NotesEmbeddedObject
    Set db = session.CurrentDatabase
    Set doc = New NotesDocument( db )
    Set rtitem = New NotesRichTextItem( doc, "Body" )
    Set object = rtitem.EmbedObject _
    ( EMBED_ATTACHMENT, "", "c:\jim.sam")
    doc.Form = "Main Topic"
    doc.Subject = "Here's Jim's document, as an attachment"
    Call doc.Save( True, True )
  3. This script is identical to the one above, except that it creates an embedded object using the file .JIM.SAM
  4. Dim session As New NotesSession
    
    Dim db As NotesDatabase
    Dim doc As NotesDocument
    Dim rtitem As NotesRichTextItem
    Dim object As NotesEmbeddedObject
    Set db = session.CurrentDatabase
    Set doc = New NotesDocument( db )
    Set rtitem = New NotesRichTextItem( doc, "Body" )
    Set object = rtitem.EmbedObject _
    ( EMBED_OBJECT, "", "c:\jim.sam")
    doc.Form = "Main Topic"
    doc.Subject = _
    "Here's Jim's document, as an embedded object"
    Call doc.Save( True, True )
  5. This script is identical to the one above, except that it creates an object link using the file .JIM.SAM
  6. Dim session As New NotesSession
    
    Dim db As NotesDatabase
    Dim doc As NotesDocument
    Dim rtitem As NotesRichTextItem
    Dim object As NotesEmbeddedObject
    Set db = session.CurrentDatabase
    Set doc = New NotesDocument( db )
    Set rtitem = New NotesRichTextItem( doc, "Body" )
    Set object = rtitem.EmbedObject _
    ( EMBED_OBJECTLINK, "", "c:\jim.sam")
    doc.Form = "Main Topic"
    doc.Subject = "Here's Jim's document, as an object link"
    Call doc.Save( True, True )
  7. This script embeds a new, blank embedded object in the Body item of a document. The object is created using 1-2-3.
  8. Dim session As New NotesSession
    
    Dim db As NotesDatabase
    Dim doc As NotesDocument
    Dim rtitem As NotesRichTextItem
    Dim object As NotesEmbeddedObject
    Set db = session.CurrentDatabase
    Set doc = New NotesDocument( db )
    Set rtitem = New NotesRichTextItem( doc, "Body" )
    Set object = rtitem.EmbedObject _
    ( EMBED_OBJECT, "1-2-3 Worksheet", "", _
    "Quarterly Report" )
    Call doc.Save( True, True )
Related topics
EmbedObject method




Library | Support | Terms of use |

Last updated: Monday, October 5, 2009