How to find names for built-in dialog boxes

M

Michael Eyestone

Is the list that comes up in the VB Editor as you type

Dialogs(

the full list available? In particular, I'm trying to find out how to call
the "Modify Style" dialog.

Thanks in advance,
Michael Eyestone
Ottawa, Canada
 
H

Helmut Weber

Hi Michael,

not really a help, what I have to offer.

It seems that the list is complete.
Which doesn't help you, as there is a dialog
wdDialogEditStyle,
which may be what you want,
but doesn't do anything at all:

Dim oDlg As Dialog
Set oDlg = Dialogs(wdDialogEditStyle)
oDlg.Display

Results in nothing! :-(

If you are just interested in font then:
Dialogs(wdDialogFormatDefineStyleFont)

If you are just interested in the paragraph's layout, then:
Dialogs(wdDialogFormatDefineStylePara)

plus some more.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
M

Michael Eyestone

Helmut:

Thanks for the input. I had found that (non-functioning) one, and thought
perhaps I was using it incorrectly. Upshot is that I am evidently unable to
cause Word to show me the Modify Styles dialog box using a macro. Sad!

Cheers,
Michael
 
J

Jay Freedman

Since the Modify Style dialog needs to know which style to work on, it's a
child of the FormatStyles dialog. It's clunky (and might sometimes
malfunction), but you can use the SendKeys command to simulate pressing
Alt+M in the FormatStyles dialog this way:

Dim StyleToEdit As String
Dim dlg As Dialog

StyleToEdit = "Footer" ' just an example...
Set dlg = Dialogs(wdDialogFormatStyle)

With dlg
.Name = StyleToEdit
SendKeys "%m": .Show
End With

Set dlg = Nothing

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
T

Tony Jollans

There are some dialogs for which there are no defined constants. I don't
know of any list (bar my own somewhat incomplete one) but ..

Dialogs(1347).Show

.... will present the Modify Style dialog for the Style at the insertion
point.
 
M

Michael Eyestone

Hey, that's terrific, thanks very much! Why are things like this so hard?
Why wouldn't the help file include such a list? I mean, really.

But thanks again!

Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top