Include doclink in Lotusscript

HiHave problem to include doclink im my script, a get a Type mismatch.

Could anyone see what a did wrong.

===============

Sub Initialize

Dim session As New notessession

Dim ws As New NotesUIWorkspace

Dim server As String

Dim doc As NotesDocument

Dim memoDoc As NotesDocument

Dim item As NotesItem

Dim db As notesdatabase

Dim collection As NotesDocumentCollection

Dim rtlink As NotesRichTextDocLink



Set db = session.CurrentDatabase

Set collection = db.UnprocessedDocuments



'Control if there is more then one document selected

If (collection.count>1) Then

	Msgbox "You have more then one document selected!", 0+16,"Security Violation"

	Exit Sub

	'Control that you have select one document

Elseif (collection.count<1) Then

	Msgbox "You must select one document"

	Exit Sub

End If



Set doc = collection.GetFirstDocument





server = db.Server

' Create document an copy values

Set memoDoc = db.Createdocument

memoDoc.SendTo = ""

memoDoc.Subject = doc.DocNumber



Set item = New NotesRichTextItem( newDoc, "Body" )

Call memoDoc.AppendDocLink( db, db.Title, "Database link")



	

memoDoc.form= "Memo"

Call memoDoc.MakeResponse(doc)



Call ws.EditDocument(True, memoDoc)

End Sub

===============

Kind regards

Fredrik

Subject: Include doclink in Lotusscript

Fredrik,

Which line gives you the type mismatch???

Mike

Subject: RE: Include doclink in Lotusscript

Type mismatch is gone and now a get Illegal use of PROPERTY on this line.

Call memoDoc.AppendDocLink( db, db.Title, “Database link”)

Fredrik

Subject: Object class?

Frederik

A document is not a rich text item. The method belongs to notesrichtextitem, whereas the memoDoc is a Notesdocument. Add a rich text item to the document, then add the link to it. And: Read the design help database - it has many examples that are simple, but usually helpful to find your way around.

P.

Subject: RE: Include doclink in Lotusscript

Fredrik,

It look slike you are using a NotesDocument to do the AppendDocLink. It should be the NotesRichTextItem

Mike