none
How to change the document properties in Word 2016? RRS feed

  • Question

  • Hey all,

    I am trying to write a vbscript to automatically update certain fields etc in Word 2016.

    I am, however, stuck at trying to change the specific document properties. I would like to change the 'TITLE' and 'SUBJECT' property of my document. 

    I can implement it via the VBScript or a Macro. It has to be done with a Word 2013 or 2016 document.

    Thanks in advance!

    Kenneth


    Thursday, September 29, 2016 9:37 AM

Answers

  • I actually was able to figure it out. In case someone needs it, it was simple... 

    objWord.ActiveDocument.BuiltInDocumentProperties("Title").Value = nieuweBedrijfsnaam
    objWord.ActiveDocument.BuiltInDocumentProperties("Subject").Value = nieuweProjecttitel

    Where  objWord is defined as =>

    Set objWord = CreateObject("Word.Application")

    • Marked as answer by Cennetessimus Thursday, September 29, 2016 12:06 PM
    Thursday, September 29, 2016 12:05 PM

All replies

  • I actually was able to figure it out. In case someone needs it, it was simple... 

    objWord.ActiveDocument.BuiltInDocumentProperties("Title").Value = nieuweBedrijfsnaam
    objWord.ActiveDocument.BuiltInDocumentProperties("Subject").Value = nieuweProjecttitel

    Where  objWord is defined as =>

    Set objWord = CreateObject("Word.Application")

    • Marked as answer by Cennetessimus Thursday, September 29, 2016 12:06 PM
    Thursday, September 29, 2016 12:05 PM
  • Thanks for sharing your solution. I'd like to share another solution which allows programmers to access and modify built-in document properties as well as custom document properties by using C# or VB.NET.

    How to set Word document properties

    Friday, September 30, 2016 6:13 AM