Office Word Programming >> How tell via Automation if document has been changed?

by Bill » Tue, 31 Oct 2006 23:32:58 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?

--
.Bill.


Office Word Programming >> How tell via Automation if document has been changed?

by Shauna Kelly » Wed, 01 Nov 2006 18:11:47 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









Office Word Programming >> How tell via Automation if document has been changed?

by Bill » Thu, 02 Nov 2006 05:26:23 GMT







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.

--
.Bill.


How tell via Automation if document has been changed?

by Shauna Kelly » Sat, 04 Nov 2006 07:32:12 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











Similar Threads

1. PowerPoint: Change the text in a text type shape via automation

2. 'Changes made to Normal.dot' message in Word 2000 via Automation

Hi,

The next interesting thing I'm finding (among others) is that Word 2000
seems to produce the following message on its first run:  "Changes have been
made that affect the global template, Normal.dot. Do you want to save those
changes?" and then it produces a Save As dialog.

Office 2000 was just installed on this machine running WinXP SP1, after
having Office 2003 uninstalled.

So now I'm wondering two things:

  1. Why does the message get displayed when I'm not
     modifying any documents at the time at which the error
     message appears.*

  2. Is this something I should be overly concerned with
     (i.e. will I see this often)?

Thanks in Advance!

evan stone | software engineer
----------------------------------------
santa rosa, ca, usa

* There are two methods that I've created that I use at my application's
launch that I use to determine: a) if Word is installed, and if it is, then
it b) get its version. The methods do NOT open an existing or create a new
document. They merely do those operations and then Quit. However, if it
would be useful to see the code I'm using (it's LATE BOUND C# code), I can
post the functions -- perhaps I'm not including a parameter I should be
including or something along those lines...


3. Changing pen (ink) thickness in ppt slideshow via automation

4. I am having trouble with saving my microsoft word documents

it is unresponsive and essentially stalls when i try to save a document.  is 
this a bug?

5. I am having trouble in copying a text between word documents - MS Word Support

6. Printing Word document via automation

When I attempt to print a Word document using automation, the document will
not print. I'm "talking" to Word via a DLL written in VB6. The document is
getting saved, also being done in the DLL. What's really wierd is that if I
step thru the DLL code using the debugger, as soon as .PrintOut method for
the document gets called, it prints. However, running thru the code w/o the
debugger, nothing happens. I've added a few DoEvents to give up some CPU
time, but this hasn't done any good.

I'm running XP Pro, Office 2000.

Ideas anyone?



7. Slow opening of RTF documents in Word via automation

8. How do I get Word to tell me the page number that I am viewing

I followed Anne Troy's advise and click on the view option and found that the 
status bar was already checked in my MS Word 2002 version.  I then opened a 
document that had 45 pages and testes her advise and I still did not get the 
desired solution.  

"Milly Staples [MVP - Outlook]" wrote:

> Click on the right scroll bar.
> 
> --
> Milly Staples [MVP - Outlook]
> 
> Post all replies to the group to keep the discussion intact.  All
> unsolicited mail sent to my personal account will be deleted without
> reading.
> 
> After furious head scratching, Les asked:
> 
> | When I open a document that has several pages, I want to know what
> | page, column and line that I am on in the document.  This information
> | was available in previous versions of MS Word. How do I turn this
> | option on? 
> 
> 
>