I want an agent code in Lotus Script to find out the name of the $File uploaded to a document.
I have embedded file upload control in my form. I click it and upload a file, now I want to retrieve the name of the file uploaded.
So what my agent should do is when I select on the particular document on the view and run that agent, I should retrieve the corresponding document’s File name.
Subject: RE: Look in Domino Designer Help at the document “Working with attachments and embedded objects in LotusScript classes”
This is the agent I gave: But it gives Object variable not set…
Sub Initialize
Dim doc As NotesDocument
Dim rtitem As Variant
Dim object As NotesEmbeddedObject
Dim objectName As String
Set rtitem = doc.GetFirstItem( "Body" )
If ( rtitem.Type = EMBED_ATTACHMENT) Then
Set object = rtitem.GetEmbeddedObject("XYZ")
objectName = object.Name
If ( object Is Nothing ) Then
Messagebox( "Unable to find an object named Jim" )
Else
Messagebox( "objectName" )
End If
End If
Subject: RE: Look in Domino Designer Help at the document “Working with attachments and embedded objects in LotusScript classes”
If attaching the file through the web, the attachment won’t be in the field Body.
Here are some suggestions in this forum for code also:
Date
Topic
RE: $File attachments - how to get a handle on them (Kenneth Haggman 09/13/2007)
RE: Get Web Attachment W/Agent & Send To Outlook (Kenneth Haggman 04/29/2007)
RE: Detaching the attachment from file upload control (Steve Galentine 02/17/2005)
I searched for web and attachment
In the future I would suggest that when you provide error messages returned by the code, include the error line number etc. Otherwise it is very hard for people to help you. Be sure to check the Domino Designer Help for Error handling, that will help you track down issues, and make it easier for others to help you if you follow some of the suggestions in that area.