Doc links in a table

I’m having a problem inserting a doc link into a table on a form for emailing.I have a string array… that contains…

Author ,company, docUNID, DueDate

I can write all values as text to the form to email out, if I use docID as a string.

But If I try to insert as a doc link, I get a error…

for clarity’s sake I put a (if iColumn = 3) because that will be the texted UNID in the newlist array.

When I try to Appenddoclink ( fieldValue ) I get a error… need doc object.

when i edit the code to do:

set doc = db.getDocumentByID ( fieldValue)

I get a “invalid ID”).

So now I’m stuck…

can anyone help?

Call rtItem.AppendTable ( j, 3, RULER_ONE_INCH * .75, rtTableStyle)

Dim rtNav As NotesRichTextNavigator

Set rtNav = rtItem.CreateNavigator()

Call rtNav.Findfirstelement( RTELEM_TYPE_TABLECELL )



For iRow = 1 To j Step 1

	For iColumn = 1 To 3 Step 1

		call rtItem.BeginInsert ( rtNav )

		fieldValue = StrToken (newlist (iRow -1), "%", iColumn)

		If (icolumn = 3) Then

			Call rtItem.Appenddoclink( fieldValue, "whatever") <------ HERE!

		Else

			Call rtItem.Appendtext( fieldValue )	

		End If

		

					

		Call rtItem.Endinsert()

		Call rtNav.Findnextelement( RTELEM_TYPE_TABLECELL )

	Next

Next

Call maildoc.send (True)

Subject: Use the GetDocumentByUNID method

Subject: Tried that

Thank for your time Wayne…It weird whats happening…

if I remove the:

if (icolumn =3) then…else

It saves the text of the unid into the document.

Company Name … Due Date … UNID number

But if I put the if statment back … the

var fieldValue contains the value of [Link], of which I have no idea how to put into a richtext field…

I take the if statement out…fieldvalue is now a text value…

What in the heck???