Closing Word Doc in Internet Explorer

B

Bill Cunningham

I have a word doc that needs to be able to close itself
without saving changes automatically in the course of a
VBA proceedure.

This works fine when the doc is on a local drive, but most
users will be accessing it via an intranet, so the doc
will be launched inside an IE Browser Window.

When this code runs in the context of a Browser:

ThisDocument.Close wdDoNotSaveChanges

I get a word error #4605 - The command is not available as
the document is in another application.

How do I make a document close itself automatically in the
context of an IE browser window (I don't need to worry
about other browsers, the environment is strictly IE).
 
W

Word Heretic

G'day "Bill Cunningham" <[email protected]>,

what about being real nasty and just closing the browser?


Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


Bill Cunningham reckoned:
 
B

Bill Cunningham

I'd try that if I knew how.

How do you close the browser window that is displaying a
word document using VBA from within that Word Document? I
can't find a way to make this work.
 
W

Word Heretic

G'day "Bill Cunningham" <[email protected]>,

<Shrugs> Mate, I never tried, but your application object has a
parent which I suggest is the way to go.


Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


Bill Cunningham reckoned:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top