Best way to link to a document

Sorry to bring this up again, I have gone through the posts I can find on this but I just seemed to be getting more confused.

Basically I have a Main document, we will call it docA. I create response document in LotusScript we will call it docB.

What I want to do is have a link from docA to docB. What is the easiest way for me to do this?

I cannot get appenddoclink to work correctly into a richtext field. I know I had done something like this a few jobs ago, but cannot remember and do not actually have the code. I believe I had done something fairly simple, with getting the UNID and just creating a hotspot type link.

Anyway any suggestions are appreciated.

Subject: Best way to link to a document

Dim rtitem As NotesRichTextItem Set rtitem = New NotesRichTextItem( yourDoc, “Body” )

Call rtitem.AppendText("Document: " + doc.Title(0) + Chr(13) )

Call rtitem.AppendText("Link: ")

Call rtitem.AppendDocLink(doc, doc.Title(0))

Call rtitem.AppendText(“” + Chr(13) )

Subject: Thanks Brian

I do not know why I always have a tough time with this command, for some reason the context of it seems to miss me.

That did the trick, thanks

Subject: RE: Best way to link to a document

Or else something like:

Dim serverName As String

Dim server As New NotesName (db.server)

If server.Common <> Null Then

serverName = server.Common

Else

serverName = "LocalHost"

End If

Call rtitem.AppendText( " Link: notes://" + + serverName + “/” + db.filePath + “/0/” + doc.UniversalID )