View Single Post
 
Old 07-13-2016, 05:26 AM
neoported neoported is offline Windows 10 Office 2013
Novice
 
Join Date: Jul 2016
Posts: 2
neoported is on a distinguished road
Default INCLUDETEXT is file doesn't exist

I'm looking to include a merge field that pics up a Windows user's signature based on their login name and whilst I've got a macro to pick up the username and replace the @@WinUsername@@ bit.

It's working if the user's signature file exists but it produces an "A field calculation error occurred in record 1" if the file doesn't exist and it's looking to display the default.docx file.

It then includes the default.docx file as required. Just looking to get rid of the error message.

So, inspite of my ramblings I'd like to inclde a file if it exists and if it doesn't to include a default file instead of the Error file not found message. Is this possible.

Below is my work in progress

{IF
{ INCLUDETEXT "Q:\\Letters\\Signatures\\@@WinUsername@@.docx "} ="Error*"
{ INCLUDETEXT "Q:\\Letters\\Signatures\\default.docx"}
{ INCLUDETEXT "Q:\\Letters\\Signatures\\@@WinUsername@@.docx "}
}

Thanks in advance
Reply With Quote