Attach a file using a button (LotusScript or Formula Language)?

Hi All,

Im trying to control how users attach files to an open document (One file attachment in a particular field). Here is what I have used so far:

@If(@Attachments = 1;@Prompt([Ok];“Attach”;“You are only allowed to attach one file to this document”);@Do(@Command([EditGotoField]; “cattach”);@Command([EditInsertFileAttachment])))

This works fine but the field I am attaching to has to be editable.

Basically what I need to do is only allow the user to attach ONE file to a particular field in a document.

Any ideas?

Subject: RE: Attach a file using a button (LotusScript or Formula Language)?

The Querysave validation code in the linked document guarantees the user cannot save except if there is exactly one attachment in the field.