I am trying to create a button on a form that will copy the contents of a rich text field from a profile document to a rich text field on the existing, open document. I’ve muddled through the following script but it generates a “Type Mismatch” error. I think I may be confusing the doc with the uidoc. or something. Anyway, if anyone can point me in the right direction I’d appreciate it. Thanks…
Profile document is named “AP”
Rich text field in profile document is “Test”
Rich text field in current document is “Body”
Sub Click(Source As Button)
Dim session As New NotesSession
Dim ws As New notesuiworkspace
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim uidoc As notesuidocument
Dim ItemA As Variant
Set db = session.CurrentDatabase
Set uidoc=ws.currentdocument
Call uidoc.save
Set doc = db.GetProfileDocument("AP")
Set ItemA = doc.GetFirstItem("Test")
Call itemA.CopyItemToDocument(uidoc,"Body")
End Sub