Closing WORD Document Without Saving Changes

B

Brian McGuigan

I have openened a WORD Document from Access changed its
contents, printed it and now wish to close it - without
saving the changes. However the WORD vb constant
wdDoNotSaveChanges is not defined in my Access routine.
I've tried the knowledge base, but cannot find its numeric
value. Does anyone know what it is?
 
D

Dirk Goldgar

Brian McGuigan said:
I have openened a WORD Document from Access changed its
contents, printed it and now wish to close it - without
saving the changes. However the WORD vb constant
wdDoNotSaveChanges is not defined in my Access routine.
I've tried the knowledge base, but cannot find its numeric
value. Does anyone know what it is?

The value is 0. I found out by setting a reference to the Microsoft
Word 10.0 Object Library, and then just entering

?wdDoNotSaveChanges

in the Immediate Window.
 
M

MDW

You also should be able to trick Word into thinking the document was already
saved by setting its Saved property to True.

objYourDoc.Saved = True
objYourDoc.Close ' Should not prompt for save
 
B

Brian McGuigan

Many Thanks Guys - Great Stuff

MDW said:
You also should be able to trick Word into thinking the document was already
saved by setting its Saved property to True.

objYourDoc.Saved = True
objYourDoc.Close ' Should not prompt for save
 

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