Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Close Word doc from Extra

Status
Not open for further replies.

JeaShe

Programmer
Mar 9, 2004
89
US
The macro I run opens a Word doc and after going through a routine, it prints the doc. Then I want to close the doc (not Word, just that doc) without saving the changes. The VBA code is:

Documents.Close SaveChanges:=wdDoNotSaveChanges

With minor differences mine would read:
objDoc.Close SaveChanges:=wdDoNotSaveChanges

However Extra considers everything after Close a new variable. I know that objDoc.Close works but it leaves the box to save the doc up. Any ideas how I can get Extra to recognize the command not to save changes?


 
Usually these text constants actually have an integer value (flag). If you hover over the text in VBA it will tell you the integer. Plug that into EB and it will likely work.

Something like this:
objdoc.close 3

calculus
 
It works beautifully in Word, but how do I do it in Excel?? Can't get the same thing to work there! So frustrated!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top