Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Close Word doc from Extra

Close Word doc from Extra

Close Word doc from Extra

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?

RE: Close Word doc from Extra

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


RE: Close Word doc from Extra

good idea... I'll try it

RE: Close Word doc from Extra

It works beautifully in Word, but how do I do it in Excel?? Can't get the same thing to work there! So frustrated!

RE: Close Word doc from Extra

"oBook.close false" works for me.


RE: Close Word doc from Extra

Woo-hoo!  It works! Thanks Calculus

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close