Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Dec 2000
    Location
    Reading/Swindon, Berkshire, United Kingdom
    Posts
    664
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lotus Notes Email (LN 4.5 - Office 2K)

    I use the two following basic methods to send Lotus Notes email (4.5 from office 2K):

    The CreateDocument method can be used to add text to the body and to attach a file.

    The CurrentDocument method can be used to add text to the body and to paste a picture in from the clipboard.

    Does anybody have code samples of - or even know of - a single method that will allow all three, i.e., append text, pictures and files? I have the feeling that I should be able to attach the relevant files using the CreateDocument method, save as a draft and then access it using the CurrentDocument method to paste in more text and pictures, but this strikes me as being unduly complicated (and i have to admit that my initial attempts at this have been unsuccesful) and I'd like to find a way of doing all three at the same time.


    <pre>Sub LotusNotes_CREATEDOCUMENT()
    'this method allows text and file attachments

    'declare objects
    Dim session As Object
    Dim db As Object
    Dim doc As Object
    Dim body As Object

    'set up notes session & create new memo
    Set session = CreateObject("Notes.NotesSession")
    Set db = session.GETDATABASE("SERVER01/GB/Company", "mailmname.nsf")
    Set doc = db.CREATEDOCUMENT
    Set body = doc.CREATERICHTEXTITEM("Body")
    doc.Subject = "Email Test - CREATEDOCUMENT METHOD"
    doc.Form = "Memo"

    'append text
    Call body.APPENDTEXT(Chr(10) & "add some text" & Chr(10))
    ' attaches file
    Call body.EMBEDOBJECT(1454, "", "C:testfile1.xls")

    'send the doc
    Call doc.Send(False, "My Name")

    'delete all references to Notes objects
    Set doc = Nothing
    Set db = Nothing
    Set session = Nothing
    Set body = Nothing

    End Sub
    </pre>




    <pre>Sub LotusNotes_CURRENTDOCUMENT()
    'this method allows text and pictures from the clipboard

    'declarations
    Dim Workspace As Object
    Dim doc As Object
    Dim UIDoc As Object

    'create NotesUIWorkspace class:
    Set Workspace = CreateObject("Notes.NotesUIWorkspace")
    Set doc = Workspace.COMPOSEDOCUMENT _
    ("SERVER01/GB/Company", "mailmname.nsf", "Memo")

    'create NotesUIDocument class:
    Set UIDoc = Workspace.CURRENTDOCUMENT

    'set up document fields
    Call UIDoc.FIELDSETTEXT("SendTo", "My Name")
    Call UIDoc.FIELDSETTEXT("Subject", "Email Test - CURRENTDOCUMENT METHOD")

    'append text
    Call UIDoc.FIELDAPPENDTEXT("Body", "add some text")
    'pasting in from clipboard
    Range("a1:b4").Copy 'the range to copy(assuming workbook is open!)
    Call UIDoc.GOTOFIELD("Body")
    Call UIDoc.GOTOBOTTOM
    Call UIDoc.Paste

    'send the doc
    Call UIDoc.Send
    UIDoc.Close

    'delete all references to Notes objects
    Set Workspace = Nothing
    Set doc = Nothing
    Set UIDoc = Nothing

    End Sub
    </pre>



    Ideas, anyone?

  2. #2
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Leuven, Vlaanderen, Belgium
    Posts
    322
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Re: Lotus Notes Email (LN 4.5 - Office 2K)

    Brooke,
    I'm not sure at all that this helps you any further, but did you check out the Lotus web site support pages already? I once have started automating Novell Groupwise, and this company had a (if I remember it right, rather well documented) object model available to automate their e-mail software... Maybe some folks at Lotus had already the same idea...

  3. #3
    5 Star Lounger
    Join Date
    Dec 2000
    Location
    Reading/Swindon, Berkshire, United Kingdom
    Posts
    664
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Lotus Notes Email (LN 4.5 - Office 2K)

    Hasse,

    Thanks. I have spent some time there, but you never know what a little more could throw up. Back to the Sandbox!

  4. #4
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Leuven, Vlaanderen, Belgium
    Posts
    322
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Re: Lotus Notes Email (LN 4.5 - Office 2K)

    <img src=/S/yep.gif border=0 alt=yep width=15 height=15> Good luck!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •