Displaying Properties Dialog Box in a Macro

Written by Allen Wyatt (last updated December 16, 2022)
This tip applies to Word 2007, 2010, and 2013


2

Bill wonders how he can get the Properties dialog box for a document to display from within a macro. In Word 2003 he can do this manually by choosing Properties from the File menu, but the process is a bit more complex in Word 2007 with the need to display the Document Information Panel and then displaying the advanced properties.

Even though the way that you display the Properties dialog box is different in Word 2007 than it is in earlier versions of the program, the way you do it in a macro is not different. You can display a Word dialog box in VBA by using this syntax:

Dialogs(name).Show

This works because VBA makes accessible dialog boxes through the Dialogs collection. The trick is to determine what you should use in the place of name in the syntax. For instance, if you wanted to display the Open dialog box, you could use the following:

Dialogs(wdDialogFileOpen).Show

You can find a complete list of dialog box constants at this site:

http://msdn.microsoft.com/en-us/library/bb214033.aspx

Unfortunately, there is no "wdDialogFileProperties" constant that you can use with the Dialogs collection. This means that the full Properties dialog box cannot be displayed. You can, however, display "pieces" of the dialog box. For instance, you could use the following to display the information found on the Summary tab of the Properties dialog box:

Dialogs(wdDialogFileSummaryInfo).Show

This will work in any version of Word, including Word 2007. If you want to display the Document Information Panel, which is new to Word 2007, then you do so not by using the Dialogs collection, but by using the following code:

Application.DisplayDocumentInformationPanel = True

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (7482) applies to Microsoft Word 2007, 2010, and 2013.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Changing Body Text to a Heading

When working on a document in Outline view, you may need to change regular body text to a heading in the outline. It's ...

Discover More

Locking All Non-Empty Cells

Need to make sure that your worksheet is locked, with only the blank cells accessible to editing? You can do this easily ...

Discover More

Mouse Scroll Wheel Doesn't Work with Some Worksheets

When you use the mouse wheel, the normal behavior is to scroll vertically through your worksheet. If the mouse wheel ...

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!

More WordTips (ribbon)

Changing the Default Drive

Macros can be used to read and write all sorts of files. If those files are on a different drive than the current one, ...

Discover More

Controlling Repagination in Macros

Want to turn off document repagination while your macro does its work? Here are two approaches you can use.

Discover More

Moving the Insertion Point to the Beginning of a Line

If you need to move the insertion point within your macro, then you'll want to note the HomeKey method, described in this ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is seven more than 1?

2023-04-11 05:21:49

Lene Fredborg

It is possible to open the Properties dialog box via VBA even if Microsoft has not provided a constant for the dialog box. See my article "How to show the Properties dialog box via VBA": https://www.thedoctools.com/word-macros-tips/word-macros/show-properties-dialog-via-vba/.


2019-03-28 14:08:35

Neman Syed

Thanks for your tip Allen. It's a pity something so important - metadata location - is buried enough to make it daunting for a user. I'm currently designing a template and looking for an easy way to have the users maintain custom document properties. I didn't want to use a macro, but may have to, as it's been difficult to find the corresponding toolbar button.

The Document Information Panel has been removed as of Office 2016 as per https://support.office.com/en-gb/article/where-is-the-document-information-panel-in-office-2016-767bbbbb-27aa-42e8-81dc-9ed5cf06e6e0. Your readers may need to take action accordingly.


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.