FieldGetText & EmbedObject

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

Subject: RE: FieldGetText & EmbedObject

Yes, that method does not take an array argument. Therefore, you must write a loop in your code to process the array elements one at a time.

Subject: RE: FieldGetText & EmbedObject

Thanks, do you have a ex. for me how to solve this??? Has not work very much with array in LS…

Subject: RE: FieldGetText & EmbedObject

Forall gloria in path_and_nameSet x=rtf.EmbedObject(1454,“”, gloria)

’ if there’s something else you’re doing with “x” do it here.

End Forall

If you’re going to work with LotusScript, you might want to put in some study time on basic programming. Arrays are nothing special.