1

I have a Word 2010 macro that updates fields in the document when it is opened - LASTSAVEDBY, FILENAME and DATESAVED. This is the macro recommended by Microsoft in their knowledgebase article The FILENAME field does not automatically update when you open a document in Word

That works great, however when the document is opened and later closed, it always prompts to save changes, whether changes have been made or not.

Is there any code I can add to the macro that immediately marks the document as not edited, so that the prompt to save only appears when further edits are made?

Otherwise, every time someone reads a document, they will probably end up saving it with their details rather than the person who really last edited it.

1 Answer 1

3

Use the Document.Saved Property. For example in VBA: ActiveDocument.saved = true

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.