Re: Arguments (I think that is what they are called)
From: Greg Maxey (gmaxey_at_whamspammvps.org)
Date: 08/29/04
- Next message: anonymous_at_discussions.microsoft.com: "Re: How to add items to Right Click menu"
- Previous message: Jay Freedman: "Re: Arguments (I think that is what they are called)"
- In reply to: Peter Hewett: "Re: Arguments (I think that is what they are called)"
- Next in thread: Jay Freedman: "Re: Arguments (I think that is what they are called)"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 29 Aug 2004 11:49:13 -0400
Peter,
I have Help installed, I just wasn't drilling down far enough. I found the
information that you mentioned. Thank you.
You are not the first to suggest I buy a book. I have a recommendation
(can't think of it right now) that I will look for next chance I get.
I have also been reading the Office 97 Programer's Guide as it relates to
Word.
-- Greg Maxey A peer in "peer to peer" support Rockledge, FL To e-mail, edit out the "w...spam" in gmaxey@whamspammvps.org Peter Hewett wrote: > Hi Greg Maxey > > Absolutely! The first thing is to make sure you have the VBA help > files installed. From within the VBA IDE you can then select the > word "Close" from ActiveDocument.Close and press F1. On the system > I've currently got booted (Word 2003) I get the following info from > the helpfile: > > Closes the specified document or documents. > > expression.Close(SaveChanges, OriginalFormat, RouteDocument) > expression Required. An expression that returns one of the above > objects. > > SaveChanges Optional Variant. Specifies the save action for the > document. Can be one of the following WdSaveOptions constants: > wdDoNotSaveChanges, wdPromptToSaveChanges, or wdSaveChanges. > > OriginalFormat Optional Variant. Specifies the save format for the > document. Can be one of the following WdOriginalFormat constants: > wdOriginalDocumentFormat, wdPromptUser, or wdWordDocument. > > RouteDocument Optional Variant. True to route the document to the > next recipient. If the document doesn't have a routing slip attached, > this argument is ignored. > > > > Also, you can use the ObjectBrowser (F2). You can then browse to > Document, Close. In the pane at the bottom of the window it will > display: > > Sub Close([SaveChanges], [OriginalFormat], [RouteDocument]) > Member of Word.Document > > > > The online help is the most helpful as it informs you that the > parameter SaveChanges is an Enum of type WdSaveOptions. > WdSaveOptions has the following constants defined for it > wdDoNotSaveChanges, wdPromptToSaveChanges and wdSaveChanges. > > You should use the names (wdDoNotSaveChanges, wdPromptToSaveChanges > or wdSaveChanges) rather than try to find and use their numeric > value. The whole point of an Enum is that it generates a list of > named constants that makes the code more comprehensible. > > Me thinks you would find it extremely useful to purchase a book on > VBA or VB! > > HTH + Cheers - Peter > > > "Greg Maxey" <gmaxey@whamspammvps.org>, said: > >> 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.
- Next message: anonymous_at_discussions.microsoft.com: "Re: How to add items to Right Click menu"
- Previous message: Jay Freedman: "Re: Arguments (I think that is what they are called)"
- In reply to: Peter Hewett: "Re: Arguments (I think that is what they are called)"
- Next in thread: Jay Freedman: "Re: Arguments (I think that is what they are called)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|