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

Generating a List of Dates

When creating tracking documents in Word, you may need to come up with a series of dates in the document. You can type ...

Discover More

Sorting Conditional Formats Properly

Conditional formatting can be a great tool to get your data looking just the way you need. However, when you sort data ...

Discover More

Minimizing and Correcting Propagation of Similar Styles

When there are multiple users working with a document, it can collect a number of unwanted styles over time. Here are ...

Discover More

Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!

More WordTips (ribbon)

Counting the Instances of a Text String

Sometimes it is helpful to know how often a particular phrase appears within a document. If you need to know such a ...

Discover More

Accessing Paragraphs in a Macro

Need to process a document, paragraph by paragraph, in a macro? It's easy to do once you understand that Word's object ...

Discover More

Determining the Number of Paragraphs in a Document

When using a macro to process a document in some way, you often need to know the number of paragraphs in the document. ...

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 2 + 2?

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.