Hi,
I’m tring to compose a memo with a attachment.
The filename and path is stored in the path_and_name.
This code work for one file but get error with more files. Since the value I get from path_and_name = uidoc.FieldGetText( “SwFilePathName” )is multi value and it seems the Set x=rtf.EmbedObject(1454,“”, path_and_name) does not handle this value.
Get error can not find the file.
Any body can help me???
Sub Click(Source As Button)
Const MAILTEXT = "This is the text sent in the memo"
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim path_and_name As String
Set uidoc = workspace.CurrentDocument
Dim session As New NotesSession
' users mail database
Dim db As New NotesDatabase( "", "" )
Dim memo As NotesDocument
Dim rtitem As NotesRichTextItem
Dim x As NotesEmbeddedObject
Call db.OpenMail
Set memo = New NotesDocument(db)
Dim rtf As New NotesRichTextItem(Memo, "Body")
Messagebox( db.Title & " on server " & db.Server )
'Set db = session.CurrentDatabase
path_and_name = uidoc.FieldGetText( "SwFilePathName" )
Messagebox( path_and_name)
Call rtf.appendtext(MAILTEXT)
Set x=rtf.EmbedObject(1454,"", path_and_name)
memo.Form = "Memo"
memo.from = "jarle Avløyp/sds"
memo.smtporiginator = "jarle@test.com"
memo.subject = "test"
Memo.SendTo = "Jarle@usa.com"
Memo.Subject = "Here's the document you wanted"
Call Memo.Send( False )
End Sub