Jay
Sun Aug 29 10:46:17 CDT 2004
Hi Greg,
Here are two ways, depending on what information you have to start
with...
- Put the cursor on the name of the method whose arguments you want,
in this case Close, and press F1. This should take you to the topic on
the syntax of the method (not the example, which is often fluff).
There should be a list of all the arguments, each with a list of
values -- sometimes spelled out, sometimes as a link that expands when
clicked. For (document).Close, I see this:
-----
SaveChanges Optional Variant. Specifies the save action for the
document. Can be one of the following WdSaveOptions constants:
wdDoNotSaveChanges, wdPromptToSaveChanges, or wdSaveChanges.
-----
- Press F2 to open the Object Browser. In the search box, type any
part of any constant you already know -- for example, SaveChanges --
and click the binoculars button. This will give you a list of all the
identifiers in VBA that contain that string anywhere in their names.
Also, constants are generally members of collections, in this case,
the WdSaveOptions collection, and selecting one in the list of found
items will cause the bottom window to show the entire collection.
Another nice part of the Object Browser is that it will show you the
numeric values of the named constants. This is useful when you're
programming Office automation in VB or another language using late
binding, when the app doesn't have the definitions of the constants at
design time.
--
Regards,
Jay Freedman
http://aspnet2.com/mvp.ashx?JayFreedman
Microsoft Word MVP FAQ:
http://word.mvps.org
"Greg Maxey" <gmaxey@whamspammvps.org> wrote:
>Is there a way of finding a list of the various arguments a method can have.
>I stumbled around for over an hour the other day trying to find the correct
>"=wdDoNotSaveChanges" to replace "wdPromtToSaveChanges" found in the
>following VBA Help example for the Close method.
>
>ActiveDocument.Close _
> SaveChanges:=wdPromptToSaveChanges, _
> OriginalFormat:=wdPromptUser
>
>Since there doesn't appear to be a auto suggestion feature for these
>"wd...." type elements and the help file only listed this one example, how
>do you learn what works other than repeated guessing at what might work?
>
>Thanks.