Hi,I use a lotus script agent to get a special file from a folder and put it in an email. That works greate. Now I want to get all files in a special folder and put them into a lotus document.
My problem is, how can I get the whole content of the folder without specify the single filenames ?
Now I use the following code without success:
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim rtitem As NotesRichTextItem
Dim object As NotesEmbeddedObject
Dim recipient As String
Set db = session.CurrentDatabase
Set doc = New NotesDocument( db )
Set rtitem = New NotesRichTextItem( doc, "Body" )
Call rtitem.AppendText("XXXX")
Call rtitem.AddNewLine( 2 )
Call rtitem.AppendText(">>XXX<<")
Call rtitem.AddNewLine( 2 )
Set object = rtitem.EmbedObject _
( EMBED_ATTACHMENT, "", "/home/skrueger/*")
recipient = "s.krueger@aswo.com"
doc.Principal = "CN=Info/O=aswo"
doc.SendTo = recipient
doc.Form = "Memo"
doc.Subject = "TEST"
Call doc.Save( False, True )
Call doc.Send( True )
Subject: RE: Using EMBED_ATTACHMENT to get all files in a folder
Thanks for your help.I added it to my code. But now I´ve the problem, that the email is send, but there´s attachment in my email.
Why not ? There´s no error message in the logfile.
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim rtitem As NotesRichTextItem
Dim object As NotesEmbeddedObject
Dim recipient As String
Dim pathName As String, fileName As String
Set db = session.CurrentDatabase
Set doc = New NotesDocument( db )
Set rtitem = New NotesRichTextItem( doc, "Body" )
Call rtitem.AppendText("Mit freundlichen Grüssen, ASWO International Service GmbH")
Call rtitem.AddNewLine( 2 )
Call rtitem.AppendText(">>Bitte antworten Sie nicht auf diese Mail; sie wurde automatisch erstellt und verschickt.<<")
Call rtitem.AddNewLine( 2 )
pathName$ = "/home/skrueger"
fileName$ = Dir$(pathName$, 0)
Do While fileName$ <> ""
fileName$ = Dir$()
Set object = rtitem.EmbedObject _
( EMBED_ATTACHMENT, "", "/home/skrueger" & fileName$)
Loop
recipient = "s.krueger@aswo.com"
doc.Principal = "CN=Info/O=aswo"
doc.SendTo = recipient
doc.Form = "Memo"
doc.Subject = "TEST"
Call doc.Save( False, True )
Call doc.Send( True )