none
Accessing Project.CustomDocumentProperties RRS feed

  • Question

  • In the office Dev Center, there's an example code that loops through the document properties until it finds the correct one. (see: https://msdn.microsoft.com/en-us/library/office/ff862912.aspx). I'm wondering if there's a way to access custom properties directly i.e. without looping through all properties, e.g.:

    sTest = Office.DocumentProperty("work").value

    But this does not work. Any ideas?

    Sunday, May 21, 2017 10:58 AM

Answers

  • Hulsmu5,

    Let's say I added a new custom document property called "Prop1" with a value of "Bob" to the active project. To access that value I would use the following syntax:

    activeproject.CustomDocumentProperties("Prop1")

    Hope this helps.

    John

    • Marked as answer by Huismu5 Monday, May 22, 2017 6:51 AM
    Sunday, May 21, 2017 9:09 PM

All replies

  • Hulsmu5,

    Let's say I added a new custom document property called "Prop1" with a value of "Bob" to the active project. To access that value I would use the following syntax:

    activeproject.CustomDocumentProperties("Prop1")

    Hope this helps.

    John

    • Marked as answer by Huismu5 Monday, May 22, 2017 6:51 AM
    Sunday, May 21, 2017 9:09 PM
  • Thanks for clarifying this John. MicroSoft's documentation left me confused in this case.
    • Edited by Huismu5 Monday, May 22, 2017 6:57 AM
    Monday, May 22, 2017 6:56 AM
  • Huismu5,

    You're welcome and thanks for the feedback.

    John

    Monday, May 22, 2017 1:07 PM