Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2006

Tip: Looking for answers? Try searching our database.

How tell via Automation if document has been changed?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bill - 31 Oct 2006 16:32 GMT
If I open Word via automation and let the user view, and possibly edit,
a document, how can I tell via Automation if the document has been
changed?

Signature

.Bill.

Shauna Kelly - 01 Nov 2006 11:11 GMT
Hi Bill

You can do this if you turn on Track Changes and then use
ActiveDocument.Revisions.Count. If it's > 0 then some changes have been
made.

You'll also need to give the user a mechanism to accept or reject the
tracked changes and to turn off tracked changes.

There's some information on how Track Changes works at
http://www.ShaunaKelly.com/word/trackchanges/HowTrackChangesWorks.html

Hope this helps.

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

> If I open Word via automation and let the user view, and possibly edit,
> a document, how can I tell via Automation if the document has been
> changed?
Bill - 01 Nov 2006 22:26 GMT
> Hi Bill
>
[quoted text clipped - 18 lines]
> >
> > --  .Bill.

Thanks Shauna. Word knows internally that a document has benn changed
since it prompts you to save the document when you close Word only if
the document has been changed. I was hoping that there would be a way
to access that flag.

Signature

.Bill.

Shauna Kelly - 04 Nov 2006 00:32 GMT
Hi Bill

Ah - if that's all you want, you can use ActiveDocument.Saved. If it's True,
then the document is saved. If it's False then the document is "dirty" and
the user would get a "do you want to save" message on exiting Word.

But that won't necessarily tell you if the document has been changed. If I
open a document, change it and save it, then the .Saved property will be
True, but I have made changes.

Hope this helps.

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

>> Hi Bill
>>
[quoted text clipped - 23 lines]
> the document has been changed. I was hoping that there would be a way
> to access that flag.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.