See Notes Help for adding a custom @Formual button to your workspace. Use this formula. It does these things.
<ul><li>Use it from any Notes document. </li><li>It stops evaluation if the current document has no Subject field or the document has no attachments. </li><li>It assigns the attachment name to the subject if there is only one attachment.</li><li>It prompts you to pick the attachment name you want in the Subject if there is more than one attachment. </li></ul>
Don’t know if that’s what you wanted, but it is one way to do it.
@Prompt([ok];”No Subject Field” ; “The current document does not have a Subject field.”) ; @return(0)); “”);
varNames := @AttachmentNames;
@If(VarNames = “”;
@Prompt([Ok];”No Attachments”; “There no attachments on this document. Please add an attachment and try again”);
varSubject := @If(
@Elements(varNames ) = 1; varNames ;
@Prompt([OkCancelList];”Choose Attachment Name”; “Choose attachment name to assign to Subject”; “”; varNames));