Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2007

Tip: Looking for answers? Try searching our database.

How to access built-in dialog boxes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kc - 19 Apr 2007 22:10 GMT
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
Lene Fredborg - 20 Apr 2007 12:10 GMT
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

Signature

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

> How do you find the numeric value of a built-in dialog box, such as:
>
[quoted text clipped - 7 lines]
> Thanks,
> kc
kc - 20 Apr 2007 16:50 GMT
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

> 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?
[quoted text clipped - 26 lines]
> > Thanks,
> > kc
Stefan Blom - 23 Apr 2007 08:33 GMT
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.)

Signature

Stefan Blom
Microsoft Word MVP

> Thnaks, Lene for you response.  The article had some helpful suggestions, but
> was unable to provide me with what I need.
[quoted text clipped - 45 lines]
> > > Thanks,
> > > kc
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.