vurheart.blogg.se

How to insert file name in word document footer
How to insert file name in word document footer







how to insert file name in word document footer

Type in "Name": "FileBaseName" "Value": "MyTempReport".

how to insert file name in word document footer

  • In MS Word Menu with MyTempReport.docx open > File > Info > Properties: Click > Advanced Properties.
  • So another workaround is to create custom property FileBaseName with a hard coded value "MyDocumentBaseName":Ĭreate the FileBaseName custom property and assign it your value: Custom propertyīut you may want to avoid associating any macro with your word document to avoid security issues (e.g. Writing a macro, as has suggested, is probably the most convenient work around. I invite you, and others visiting this post, to up-vote that suggestion. Long term: Feature requestįor the long term I've made a feature request with Microsoft at: Indeed there is no "basename only" option for the FileName field.
  • Inserting a File Name without an Extension.
  • Two more pages to help you with your problem (both relying on Macros.): Maybe you could explain some more what you want to achieve with having the filename in the document header? Are you trying to use the filename in the document header to set some PDF property during conversion? Why not use the Document Title? Do you need the original filename in the PDF later - why? Also this Macro would run once and you would need to run it again when the filename changes. ".doc" - if you safe a ".docx" the "." would be preserved. What it does is simply strip the last 4 characters of the "Filename string" e.g. Selection.InsertBefore Text:=Left(ActiveDocument.Name, Len(ActiveDocument.Name) - 4) So, either you change that setting or you need some code.Ī very simple Macro would be the following: Sub InsertCurrentFileName() To show or not to show (Shakespearean style) the extension is purely up to the Windows Explorer setting to show or hide known file extensions.

    how to insert file name in word document footer

    Insert > QuickParts > Field > FileName is the way to go, but as you see from the screenshot below, you do not have the option to turn the file extension on or off.









    How to insert file name in word document footer