Skip to main content
Information Mgmt
New to Lotus
How to buy
Live demos
Technical library
Forums & community
Java™ technology
Open source
SOA and Web services
Web development
My developerWorks
About dW
Submit content

developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 4 and 5 Forum

Notes/Domino 4 and 5 Forum



Attaching files to document
Irshad Khan 1.Dec.11 04:34 AM a Web browser
Domino Designer -- Agents All Releases Windows XP

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");
can anyone help plsss..

  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Advanced search

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Forum use and etiquette
Native Notes Access
Web site Feedback

  Lotus Support
Lotus Support
Product support pages index
Search knowledge base (Technotes)
Search support downloads
Lotus Support RSS

IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM SmartCloud Meetings
IBM Web Content Manager
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow