I have my code to handle two attachments with same file name when I build URL link on web page. I just want to confirm here with you guys if it is fine. In Lotus Notes, if two attachments have same file name, then NotesEmbeddedObject.Source will have same value. But, I noticed NotesEmbeddedObject.Name returns different value. Then I come up with the following idea and confirm with you guys and see if it is ok.
Let’s say, we have two attachments with same file name “data.txt”. After attached in document, NotesEmbeddedObject.Source of document returns “data.txt” for two of them. But NotesEmbeddedObject.Name of document returns “data.txt” and “ATTZ4X0N” respectively. To show these two attachments in web page, the URL will be “http://server/db/view/doc/$File/data.txt” and “http://server/db/view/doc/$File/ATTZ4X0N/data.txt”.
Sub Initialize
Dim session As New NotesSession
Dim doc As NotesDocument
Set doc = session.DocumentContext
Set rtitem=doc.getfirstitem("Doc")
Forall object In rtitem.embeddedobjects
If object.type=embed_attachment Then
If object.Source = object.Name Then 'the values of Source and Name in first attachment are same
Messagebox object.Source
Else
Messagebox object.Name & "/" & object.Source
End If
End If
End Forall
End Sub
Any post?
Thanks.