Forum Discussion

ChristineB's avatar
ChristineB
Copper Contributor
Sep 03, 2023

Can Word automatically suggest/prompt document property 'Title' when saving the document?

In Word 365, I have created a Letter template with an AutoNew macro and a userform that prompts the user to fill in various details of the letter (title/heading, recipient, case no., etc.) and this info is then put into the right places in the document AND some of that info is also stored in the document properties (general as well as custom). So far so good, all works perfectly.

 

On save, the suggested file name is as usual the first few words of the document, in this case the recipient of the letter. But since we already have registered the title in the document properties, it would be so neat if Word could suggest that instead – is that possible? With or without VBA code?

 

Suggestions are very much appreciated

  • ChristineB You should be able to make use of part of the code that creates the Document Property and with additional code, display the File SaveAs dialog, prepopulated with that information, or just have a command that simply saves the document with it.

    • ChristineB's avatar
      ChristineB
      Copper Contributor
      Thanks Doug, I will give that some thought.
      I do however not wish to display the FileSaveAs dialog as part of the AutoNew macro, I want the SaveAs dialog to be prepopulated with the document property Title as file name when the user decides to save the document the first time.
      Maybe I'll have to have a look at EventHandling and OnSave...
  • Charles_Kenyon's avatar
    Charles_Kenyon
    Bronze Contributor
    Quick question: Are you saving to the Built-In Document Property or to a Custom Document Property named "Title." If the Former, if use Insert>Quick Part>Document Property>Title, it will give your document property content; if custom, it will not.

Resources