How to access built-in dialog boxes

K

kc

How do you find the numeric value of a built-in dialog box, such as:

Dialogs(1347).Show

to display the Modify Style dialog box?

I am interested in accessing the Fill Effects dialog box to set the Lock
Aspect Ratio for an inserted picture.

Thanks,
kc
 
K

kc

Thnaks, Lene for you response. The article had some helpful suggestions, but
was unable to provide me with what I need.

The Lock Aspect Ratio is available on the Picture tab of the Fill Effects
dialog box. It is only available after you select the picture to insert. It
is not avaiable with the Selection.ShapeRange.Fill object, so I thought I
would try accessing the dialog box directly to set it.

The Fill Effect dialog box is not one the Word built-in dialog boxes with a
named constant. I found a discussion thread that dealt with accessing dialog
boxes that didn't have named constant by referencing the number of the dialog
box, such as Dialogs(1347).Show to display the Modify Style dialog box (the
example in the thread). I was wondering how I could find out what the
reference number was for the Fill Effects Dialog box, or any other dialog
boxes I may have need of in the future.

Thanks,
kc

Lene Fredborg said:
Where do you find "Lock Aspect Ratio" in the Fill Effects dialog box? Don't
you mean in the Size tab of the Format Picture dialog box?

Note that you do not need to access the dialog box in order to change the
"Lock Aspect Ratio" setting. For example, you can set the value to true like
this (in case of floating shapes, use "Shapes" instead of "InlineShapes"):
ActiveDocument.InlineShapes(1).LockAspectRatio = msoTrue

About the built-in dialog boxes:
Almost all of the built-in dialog boxes have a constant name,
"wdDialog[xxx]" (e.g. "wdDialogFileNew" for File > New). For a list of the
names, see the VBE help on "Built-in Dialog Box Argument Lists". When reading
the VBA code, it is much easier to identify dialog boxes by their names than
by their numbers.

See also the article "Getting help with calling Word's built-in dialogs
using VBA (and why doing so can be much more useful than you'd think)":
http://www.word.mvps.org/FAQs/MacrosVBA/WordDlgHelp.htm

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


kc said:
How do you find the numeric value of a built-in dialog box, such as:

Dialogs(1347).Show

to display the Modify Style dialog box?

I am interested in accessing the Fill Effects dialog box to set the Lock
Aspect Ratio for an inserted picture.

Thanks,
kc
 
S

Stefan Blom

FWIW, the LockAspectRatio property is defined for Shape and InlineShape
objects. For example:

Selection.InlineShapes(1).LockAspectRatio = msoFalse

turns off the option for the first InlineShape object in the selection.
(The property can be used analogously with Shape objects.)

--
Stefan Blom
Microsoft Word MVP


in message
Thnaks, Lene for you response. The article had some helpful suggestions, but
was unable to provide me with what I need.

The Lock Aspect Ratio is available on the Picture tab of the Fill Effects
dialog box. It is only available after you select the picture to insert. It
is not avaiable with the Selection.ShapeRange.Fill object, so I thought I
would try accessing the dialog box directly to set it.

The Fill Effect dialog box is not one the Word built-in dialog boxes with a
named constant. I found a discussion thread that dealt with accessing dialog
boxes that didn't have named constant by referencing the number of the dialog
box, such as Dialogs(1347).Show to display the Modify Style dialog box (the
example in the thread). I was wondering how I could find out what the
reference number was for the Fill Effects Dialog box, or any other dialog
boxes I may have need of in the future.

Thanks,
kc

Lene Fredborg said:
Where do you find "Lock Aspect Ratio" in the Fill Effects dialog box? Don't
you mean in the Size tab of the Format Picture dialog box?

Note that you do not need to access the dialog box in order to change the
"Lock Aspect Ratio" setting. For example, you can set the value to true like
this (in case of floating shapes, use "Shapes" instead of "InlineShapes"):
ActiveDocument.InlineShapes(1).LockAspectRatio = msoTrue

About the built-in dialog boxes:
Almost all of the built-in dialog boxes have a constant name,
"wdDialog[xxx]" (e.g. "wdDialogFileNew" for File > New). For a list of the
names, see the VBE help on "Built-in Dialog Box Argument Lists". When reading
the VBA code, it is much easier to identify dialog boxes by their names than
by their numbers.

See also the article "Getting help with calling Word's built-in dialogs
using VBA (and why doing so can be much more useful than you'd think)":
http://www.word.mvps.org/FAQs/MacrosVBA/WordDlgHelp.htm

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


kc said:
How do you find the numeric value of a built-in dialog box, such as:

Dialogs(1347).Show

to display the Modify Style dialog box?

I am interested in accessing the Fill Effects dialog box to set the Lock
Aspect Ratio for an inserted picture.

Thanks,
kc
 
Joined
May 14, 2024
Messages
1
Reaction score
0
I know this thread is an ancient archaeological find, but I found it because I had the same problem.
So if someone else does too, this may help them.

The Fill Effects dialog is 1006.
 

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