I wanted to attach a file to the documents in a view through an agent.
I had taken path name from an excel upload onto a fiel using one agent and wanted to add the file from that location using second agent.
running a lotuscript and formula agent on action button in the view
with target as 'All document in view'
But still I am not able to see the attached file in the document when opened.
Lotus Agent
Dim session As New NotesSession
Dim newdoc As notesdocument
Dim ws As New NotesUIWorkspace
Dim rtitem As NotesRichTextItem
Dim rtitemA As NotesRichTextItem
Dim object As NotesEmbeddedObject
Dim agent As NotesAgent
Dim path As String
Dim uidoc As NotesUIDocument
'On Error Goto ErrorBlock
Set xls=GetObject(doc.FilePath(0),"")
Set sheet = xls.Sheets(Cint(1))
Set agent = db.GetAgent("AttachFile")
Print "Please wait ..... Data is being Imported. "
Set newdoc = New NotesDocument(db)
newdoc.Form = "Attachment"
newdoc.EmployeeCode = Trim(Cstr(sheet.range("A" & Cstr(x%)).value))
newdoc.EmployeeName = Trim(Cstr(sheet.range("B" & Cstr(x%)).value))
newdoc.Month = Trim(Cstr(sheet.range("C" & Cstr(x%)).value))
newdoc.Txt_AttachmentPath= Trim(Cstr(sheet.range("D" & Cstr(x%)).value))
path = Trim(Cstr(sheet.range("D" & Cstr(x%)).value))
Call newdoc.Save(True,False,True)
Formula Agent
AttachmentPath = @GetDocField(@DocumentUniqueID;"Txt_AttachmentPath");
@If(AttachmentPath != "";@Do(@Command([EditGotoField];"Txt_Attachment");
@Command([EditInsertFileAttachment];AttachmentPath;"1"));"")
can anyone help plsss..

