MS Word OLE automation..!!

S

subash m j

I am working on MS Word OLE automation, suppose we enabled
the track changes and changed a word say from 'is'
to 'was', how can i get the old word ( is ) by getting the
revision objects. revision objects can give the new word.
( 'was' ) is tere any way to get the word 'is' using
revision objects ?

thanks in advance..

subash
 
C

Cindy M -WordMVP-

Hi Subash,
I am working on MS Word OLE automation, suppose we enabled
the track changes and changed a word say from 'is'
to 'was', how can i get the old word ( is ) by getting the
revision objects. revision objects can give the new word.
( 'was' ) is tere any way to get the word 'is' using
revision objects ?
Revision objects will return the word that was originally in
the text:

ActiveDocument.Revisions(3).Range.Text

At least, that's what happens with the version of Word I'm
looking at. If what you want is the new text, then this
works:

Dim rng As Word.Range

Set rng = ActiveDocument.Revisions(3).Range
rng.Collapse wdCollapseStart
rng.MoveEnd wdWord, 1
Debug.Print rng.Text

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)
 
S

subash jayan

Hi Cidney....!!

I need an important help regarding automation... while i am iterating
revision objects, some time word shows the message box 'Word finished
searching.. ' how can i stop the warning message ? or how can i know
the revision object is not present in list ?? please healp me

subash
 
C

Cindy M -WordMVP-

Hi Subash,
I need an important help regarding automation... while i am iterating
revision objects, some time word shows the message box 'Word finished
searching.. ' how can i stop the warning message ? or how can i know
the revision object is not present in list ??
You don't give us enough information.

- which version of Word is involved

- what code are you trying to use (copy / paste into your message), and
what's its purpose?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
S

subash jayan

You don't give us enough information.
- which version of Word is involved

- what code are you trying to use (copy / paste into your message), and
what's its purpose?

Hi..

I am using MS Word 2002.. my work is to get the revision objects of a
compared document. ( for example, suppose a student write one exam
using MS Word 2000, teacher will mark the changes or correct the
spelling mistakes. I need the changed word,old word ,old sentences etc
etc ). I could read the old word ( using ur sample code...thanx ) and
new word using revision object. But sometime word shows message box
like "correpted file..do u want to open" or" word finished searching
of word" etc ...i want to stop the waring message... i have used
DisplayAlert = 0 to stop it....but it again comes.... if u have any
idea...plz help me..

subash
 
C

Cindy M -WordMVP-

Hi Subash,
But sometime word shows message box
like "correpted file..do u want to open" or" word finished searching
of word" etc ...i want to stop the waring message... i have used
DisplayAlert = 0 to stop it....but it again comes.
Word (as other Office applications) was never designed to run
untended. Certain messages can simply not be suppressed. I noticed in
another thread you posted code like this:

For ind = 1 To oComments.Count

It might be better to use something like For Each cmt in doc.comments,
then I think you're less likely to encounter the "finished" message.

If you're automating word from "outside", like from VB, then this KB
article might be of some help:

HOWTO: Dismiss a Dialog Displayed by Office Application with VB
[Q259971]
http://support.microsoft.com?kbid=259971

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 

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