How to rename attachments

Description

If you are uncomfortable with unique names and want to create a solution that will override these names (generated by the @Unique formula).

Solution

Advice would be that you save word document as attachment with unique name. You are able to set the name of the attachment in the SwAttName_xx field. Of course, document would be opened under the unique name. If user needs to save that document she will need to save it on some other place under different name and in this case unique name has no influence on the handling of the document.

The attached document and all functionality resides on the unique name.

Let's put it this way, if you have two attached documents with the same name and different content you will eventually open those two documents in the same time. If this happens the first open document would be overwritten or the second would not be able to open. Therefore, I will strongly suggest that you do not change the name of the attachments unless you are creating functionality that is using attachment outside "swing" functionality like forwarding or attaching to a database that is not swing enabled.Therefore, even if you attach same document to two different Notes documents it will be attached under two different names. This is a basic functionality.

If you still want to achieve this functionality:

Copy code from the attachment to document action with or instead Template action and it will provide you with the desired name. Of course, you should change the name, currently "TestTrial_TODAY"

NewFileName = "TestTrial_" + Cstr(Today())