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"
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
Related Q&A from Brian Mahoney
Find out what types of calculations can be computed for a column in a Lotus Notes view and the best way to go about it with this expert response. Continue Reading
Find out why you can't use Formula language to include a doclink to a specific Lotus Notes view or database and need to use LotusScript instead. Continue Reading
Discover the reasons behind a Notes/Domino admistrator having trouble with disabled options in the "customize this view" section of his Lotus Notes ... Continue Reading