Trying to get the attachment name

We are trying to get the file name of an attachment in a previously created document. We know that the file is sitting in the $File object. Within the object we see the File Name: SOMETHING-Resume.doc. How can I get the file name using Lotus Script. Here is what I have thus far but the attachment is in the $FILE variable and I am needing to get the name.

Thanks in advance for your help.

Jean

Dim session As New NotesSession

Dim workspace As New NotesUIWorkspace

Dim db As NotesDatabase

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument

Dim rtitem As Variant

Dim object As NotesEmbeddedObject

Dim sourceName As String

Set db = session.CurrentDatabase

Set uidoc = workspace.CurrentDocument

Set doc = uidoc.Document

Set rtitem = doc.GetFirstItem( “AttachmentField” )

If ( rtitem.Type = RICHTEXT ) Then

Set object = rtitem.GetEmbeddedObject( “???” )

sourceName = object.Source

End If

End Sub

Subject: Trying to get the attachment name

Check the Designer Help for “associatedfiles element”. This enables you to inspect the contents of $File item.

Subject: Trying to get the attachment name

so does your code not work? Where are you getting the attachment(s) from the previously created document? The code you posted is working on the current document. You need a “key” to get the previously created document and then collect the file name(s) from it.

Subject: Trying to get the attachment name

See this → suggestion re: evaluating the @AttachmentNames function.dgg