views:

65

answers:

2

I am developing a VB6 COM add-in for Microsoft Word and I have added a button to the Ribbon which will save the document to a database. But before the document is saved, I want to take the user to the document properties window so they can fill in the properties for the document (like Title, Subject and Author). I am using the following statement to bring up the window:

Application.Dialogs(750).Display

This works fine, but it defaults to showing them the General tab. The fields for Title, Subject and Author) are on the Summary tab. Is there any way to bring up this dialog box and force it over to the Summary tab? I thought about sending keystrokes, but the tabs don't have hotkeys associated with them.

I need this to work in Word 2007 and Word 2010. The line above already works fine in Word 2003 because 2003 doesn't have a multi-tabbed properties window.

+1  A: 

You could record a macro then execute it as needed.

Ash Burlaczenko
Thanks, but nothing gets recorded in the macro when you bring up the document properties dialog.
CowherPower
+3  A: 

You can bring up a seperate box for this (works in both Word 2000, 2003, 2007 and 2010):

Application.Dialogs(wdDialogFileSummaryInfo).Display

or

Application.Dialogs(86).Display

You can also program against this dialog. See here for an example.

Otaku
Thanks! I tried using wdDialogFileSummaryInfo with the Display method yesterday but I found that it didn't save anything that was entered into the dialog. It turns out that you need to use the Show method instead. Once I tried that, it worked like a charm!
CowherPower
Great to hear it worked out!
Otaku