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

Ensuring Standardized Numbering

Want to make sure your paragraph numbering looks the same on different computer systems? It's a harder task in Word than ...

Discover More

Adding Ampersands to Custom Dictionaries

It appears that Word doesn't allow you to define custom dictionary entries that include ampersands. There are ways you ...

Discover More

Specifying a Table of Contents Entry

If you need to create a specialized table of contents, you need to know how to add TOC entries to your document. It's ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More WordTips (ribbon)

Determining an ANSI Value

You may need to determine the numeric value of a character in a macro. You can do that using the Asc function, described ...

Discover More

Selecting to the Next Punctuation Mark

Writing macros often involves selecting different parts of your document so that some sort of processing can be ...

Discover More

Trimming Spaces from Strings

When processing text with a macro, you often need to remove extraneous spaces from the text. VBA provides three handy ...

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 two more than 7?

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.