Closing WORD Document Without Saving Changes

  • Thread starter Thread starter Brian McGuigan
  • Start date Start date
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?
 
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.
 
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
 
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
 
Back
Top