Q
Problem solve Get help with specific problems with your technologies, process and projects.

Use AppendDocLink when trying to send e-mail from VB/VBA

How do you use AppendDocLink when trying to send an e-mail from VB/VBA?

The following code does not work in VB provided by you.

        Set objLink_DB = 
ObjNotes.GetDatabase(Server, NotesDb)
        Set objLink_View = 
objLink_DB.getview(NotesView)
        Set objLink_Doc = 
objLink_View.getdocumentbykey(NotesKey, True)

        If Not (objLink_Doc Is Nothing) 
Then
            Call rtItem.
AppendDocLink(objLink_Doc, "Test")
        End If

My code is:

    Set newDocM = 
mailDb.CreateDocument
    Set rtitemM = 
newDocM.CreateRichTextItem("Body")
    Set view = mailDb.GetView("(All)")
    Set Doc = view.GetFirstDocument
    newDocM.subject = 
"Document Saved from VB"
    rtitemM.AppendDocLink Doc, 
"Double-click to open document"
    newDocM.sendTo = "username"
    newDocM.Importance = "1"
    newDocM.Send (False)

It generates the message:
"Automation Error: The server threw an error"

You need to use parenthesis. Try

rtitemM.AppendDocLink (Doc, "Double-click to open document")

Do you have comments on this Ask the Expert question and response? Let us know.

Dig Deeper on Lotus Notes Domino Application Development

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close