@Command([Execute]; "winword.exe";@AttachmentNames ).
Unfortunately, this error message appears, "Use the file open Dialog box to locate document." When I right click on the file attachment it opens just fine. Do you know what's wrong with my formula?
Look at the AttachmentLaunch @Command. Note, however, you need to have the attachment selected on screen for this to work. Sometimes you can arrange for this using commands such as @Command([EditBottom]), to steer the cursor to where the attachment appears.
You can also use a combination of EditDetach and Execute @Commands, that don't require the attachment be highlighted. But for this, you need a directory to detach them to. Do not detach files to the current directory, because this is usually the Notes executable directory, and you risk overwriting files that Notes needs to function. If you know there is a temporary directory on each user's workstation with the same path, you can use that.
For instance, you might write:
@For(i := 1; i <= @Attachments; i := i + 1; @Do(@Command([EditDetach]; @AttachmentNames[i]; "C:Temp" + @AttachmentNames[i]); @Command([Execute]; "C:Temp" + @AttachmentNames[i]) ) )
Note that it is not usually necessary to explicitly call winword to launch a Microsoft Word file because if Word is correctly installed, the operating system already knows that it should be used to open .doc files.
If for some reason the above doesn't work for you, you can do something similar in LotusScript using the ExtractFile method and Shell function.
Do you have comments on this Ask the Expert question and response? Let us know.
Dig Deeper on Lotus Notes Domino Formula Language
Related Q&A from Andre Guirard
Learn how you can use LotusScript and OLE to create and populate Microsoft Excel spreadsheets, as well as a little bit about Lotus Symphony. Continue Reading
Discover options you can use if you'd like external users to be able to access a workflow-based Notes Domino application through different ... Continue Reading
Learn why you may receive the error message: "Illegal circular use: Audit Trail" when trying to open Lotus Notes documents that use copied forms. Continue Reading