How can I set an indicator to show doc modified but not saved

J

Jeff

I wanted to do a simple macro that would put an indicator either on the top
of the word window or on the status bar on the botton of the window that
would indicate if the document modified but not yet saved. I know how to
hook into the save to turn off the indicator but I can’t figure out what to
test to see if the document has been changed, how to test for the change and
how to change the status bar.

Any suggestions? Thanks for any help.
 
G

Greg Maxey

Jeff,

Determining the saved/unsaved state and the captions of the Application Bar
and Status Bar are the easy parts:

Sub Test()
If ActiveDocument.Saved = False Then
Application.Caption = "Not Saved"
StatusBar = "Not Saved"
Else
Application.Caption = "Saved"
StatusBar = "Saved"
End If
End Sub

The problem, and to my knowledge there is no clear way around it, is
monitoring for the first event that "changes" the document after it is
saved.

For example. If I open a document and run that code it will show "Saved."
If I add a few lines of text and then run that code it will show "Not
Saved." However, the fact of the matter is that the document is "Not Saved"
the instant I started typing that text. There is no event that you can
monitor to automatically fire the macro when a change occurs.

Sorry.
 

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