Many times I'll use a field code to insert the filename into the footer of a document. The field code looks like this:
{ FILENAME \*MERGEFORMAT}
The result of the field code looks like this: foobar.doc
The filename has a ".doc" suffix. When I create the PDF, the filename in the footer still has the ".doc" suffix, and not ".pdf".
What I found is that the field code uses the filename exactly as it appears in the Windows Explorer window. This may sound trivial, but to solve the problem we just need to hide the extension in Windows Explorer.
To change the setting follow these steps:
- Open Windows Explorer
- Click Tools -> Folder Options
- Click on the View tab
- Check Hide extensions for known file types
Now, after updating the field code, we get foobar instead of foobar.doc.