Attachments and UI

Does anyone know about when the Name of an attachment becomes known to the NotesDocument Class? I have a situation where a user wants to attach a file to a rich text field and have the name of the attachment automagically appear in the field below it. I’ve tried the OnChange event and defined a UIDocument which I load from NotesUIWorkspace and a NotesDocument to receive the NotesUIDocument

Dim session As New NotesSession

Dim workspace As New NotesUIWorkspace

Dim db As NotesDatabase

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument

    Set uidoc = workspace.CurrentDocument

Set doc = uidoc.Document

The document with which I’m dealing is a new document - never been saved.

Any thoughts on where I’m going wrong?

Thanks,

Jack

Subject: Attachments and UI

I have wrestled with similar things myself.I think you will find that what you want to achieve is impossible.

Domino does not save an attachment to a document until it is actually ‘submitted’ to the server. That is why you may end up with those ‘funny’ attachment names when Domino has detected non-English characters in a file name and/or found 2 attachments with the same name.

You may be able to find a way around it by really saving the document for each attached file and then re-open the document again.

Problem then is if user decides to not really save the document after all. You still have a document ‘on disk’ to take care of.

Subject: RE: Attachments and UI

That’s the way I see it too…I even tried it as a PostSave event with the SaveOption of literal zero…It dodn’t work, but I figured it might be worth a try. Thanks for the quick response