• Builtin Document Properties (VBA/Word/2000)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Builtin Document Properties (VBA/Word/2000)

    Author
    Topic
    #359368

    With the userform I have created – I’d like to pass certain values to the built-in document properties. Mainly, author, title, comments and keywords. However, I find that the built-in doc properties are read-only. Is there another way to attack this?

    Thanks

    Viewing 0 reply threads
    Author
    Replies
    • #538476

      Author and Title, at least, definitely are read/write. Is there some kind of protection on the document?

      • #538553

        Hmmm, I assumed they are read only after looking at the help file. Perhaps I misinterpreted. The document is not protected.
        How would you place a value in the Author property (for example)?

        Thanks

        • #538593

          Try something like:

          ActiveDocument.BuiltInDocumentProperties(wdPropertyAuthor) = “Yours Truly”

          Check in the helpp for BuiltInDocumentProperties for a full list of constants.

          • #538637

            Here is what I’ve been trying:
            With ActiveDocument.BuiltInDocumentProperties
            .wdPropertyAuthor = AuthorName.Text – These are the names of the text
            .wdPropertyTitle = TopicTitle.Text boxes on my form
            .wdPropertyComments = TopicDescription.Text
            .wdPropertyKeywords = ProdTitle.Text
            End With

            And here is the error message I’m getting.

            Suggestions?

            • #538649

              Catherine,

              Your code sample does not follow the “template” which Geoff provided – the “wdPropertyAuthor” for example needs to be in parentheses and directly follow “BuiltInDocumentProperties” i.e.:

              ActiveDocument.BuiltInDocumentProperties(wdPropertyAuthor) = AuthorName.Text ‘ etc.

              Also, this code is only going to work if it is located in the userform’s code module (not in a regular code module), and it needs to be in an event procedure such as the Click event for a command button.

              Gary

            • #538655

              Hey – what do you know – I followed directions and it worked!

              Thanks for expanding on Geoff’s answer.

    Viewing 0 reply threads
    Reply To: Builtin Document Properties (VBA/Word/2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: