Results 1 to 7 of 7
  1. #1
    Lounger
    Join Date
    Apr 2005
    Location
    Silver Spring, Maryland, USA
    Posts
    36
    Thanks
    0
    Thanked 1 Time in 1 Post
    I use a lot of document properties in my documents, as the official titles of things change a lot and so does the terminology.

    This means I need to insert docproperty fields often. I could write an explicit macro to insert each document property that I need, but there would be about a dozen of them per document and I'd have to make sure the right ones were in the right templates.

    What approach could I take for a macro that opens the Insert Field dialog and selects the docproperty field on its own?

    This is in Word 2010. I assume it involves opening and manipulating the dialog itself. Some pointers would be useful as I can probably work it out from there. 2010's VBA documentation is limited compared to earlier versions, it seems.

    Thanks,

    Jessica

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Lounger
    Join Date
    Apr 2005
    Location
    Silver Spring, Maryland, USA
    Posts
    36
    Thanks
    0
    Thanked 1 Time in 1 Post
    After more research, I've decided to use this inelegant approach:

    Sub InsertADocPropertyField()
    SendKeys "{d 3}"
    Dialogs(wdDialogInsertField).Show
    End Sub

    Since it doesn't have to run without a person at the keyboard, I don't need error handling. And if the number of field names starting with D changes, I'll still end up close enough to the right spot in the list of document properties with a lot fewer keypresses than I needed before.

    Maybe the next version of Office will have a version of the toolbar button to insert a doc property that supports custom properties as well as the built-ins.

    If anybody has a better idea for more elegant code, please let me know.

    Thanks,

    Jessica

  4. #3
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts
    I'm using 2007 - but have you tried customizing the Quick Access Toolbar (QAT)?
    Hunting through the "All Commands" category of commands, shows the Document Properties button. Add that to the QAT.
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  5. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by jweissmn View Post
    If anybody has a better idea for more elegant code, please let me know.
    If I needed this, I might use a toolbar drop-down wired to a macro (i.e., select the field name and it is inserted at the insertion point). This was very convenient in the old UI, but in the new one, it might be consigned to the Add-ins tab on the ribbon, which is an extra click. Hmmm...

  6. #5
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,524
    Thanks
    3
    Thanked 144 Times in 137 Posts
    I like to put document properties into Word 2010 documents by using the Content Controls rather than the fields.

    Does this post http://lounge.windowssecrets.com/ind...dpost&p=854988 give you enough information to convince you.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  7. #6
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by Andrew Lockton View Post
    I like to put document properties into Word 2010 documents by using the Content Controls rather than the fields.

    Does this post http://lounge.window...ndpost&p=854988 give you enough information to convince you.
    Thanks for that info Andrew, I hadn't thought about those differences before.
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  8. #7
    Lounger
    Join Date
    Apr 2005
    Location
    Silver Spring, Maryland, USA
    Posts
    36
    Thanks
    0
    Thanked 1 Time in 1 Post
    Yes, I put the Document Properties command on the QAT - but it only gives access to the standard properties, not the custom properties which is what I need.

    I'll go investigate the content control approach and think about the macro to a dropdown idea.

    Thanks!

    - Jessica

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •