Indeed there is no "basename only" option for the FileName field.
Long term: Feature request
For the long term I've made a feature request with Microsoft at:
https://office365.uservoice.com/forums/264636-general/suggestions/13860672-for-word-create-a-basename-only-field-option-for
I invite you, and others visiting this post, to up-vote that suggestion.
Short term workarounds
Macro (VBA code)
Writing a macro, as @DennisG has suggested, is probably the most convenient work around.
Custom property
But you may want to avoid associating any macro with your word document to avoid security issues (e.g. if you distribute your document). So another workaround is to create custom property FileBaseName
with a hard coded value "MyDocumentBaseName":
Create the FileBaseName custom property and assign it your value:
- Open a blank document in MS Word.
- Save it as "MyTempReport.docx".
- In MS Word Menu with MyTempReport.docx open > File [tab] > Info > Properties: Click > Advanced Properties ... > Custom [tab] ...
- Type in "Name": "FileBaseName"; "Value": "MyTempReport".
Insert the custom document property, FileBaseName
, in your document:
- MS Word menu > Insert [tab] > Text [group] > Quick Parts > Field ...
- From "Field Names" choose "DocProperty".
- From "Field Properties" > "Property": Choose "FileBaseName" > OK.
You should now have "MyTempReport" inserted as a field in your document.
Limitations:
- If you rename your file this won't be reflected in your
FileBaseName
field. Instead you'll have to manually change the FileBaseName
property from Advanced Properties ... (as above).
- You'll have to create this custom property in every particular document you want it in.