I want to copy the contents of a RTF and put it in the contents of an E-mail with other info. But for some reason I cant get it to work, I thought I had it a few times.
The Email has the attachment, and the doc properties shows the text, but they are not visible in the memo itself. What am I missing or doing wrong?
Sub Click(Source As Button)
Dim workspace As New NotesUIWorkspace
Dim session As New NotesSession
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim tmpstr As String
Dim db As NotesDatabase
Dim rtitem As NotesRichtextItem
Dim copyItem As NotesItem
Dim memo As NotesDocument
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
If uidoc.EditMode = False Then
uidoc.EditMode = True
End If
Call uidoc.Save
Set db = session.CurrentDatabase
Set memo = New NotesDocument( db )
Set rtitem = New NotesRichTextItem( memo, "Body" )
'ADD FIELD VALUES
tmpstr = "Services Order"
Call rtitem.AppendText("Assigned Tracking Number")
Call rtitem.AddNewLine(1)
Call rtitem.AddTab(1)
Call rtitem.AppendText(doc.GetItemValue("TrackingNo")(0))
Call rtitem.AddNewLine(2)
'PASTES THE RICH TEXT FIELD INTO THE EMAIL
Set copyItem = doc.GetFirstItem( "VendorAttachment" )
Call rtitem.AddNewLine(2)
Call rtitem.AppendRTItem( copyItem )
'CREATED THE DOC LINK
Call rtitem.AppendDocLink( doc, db.Title )
Call rtitem.AddNewLine(2)
memo.Form = "Memo"
memo.SendTo = "kld"
memo.Subject = "TEST - " & uidoc.FieldGetText("TrackingNo")
Call memo.Send( False )
End Sub