Checking upon saving fo text highlighting

J

John Doue

I need to check upon saving for the presence of any highlighting in the
document. Any help would be welcome.

Thanks
 
D

Dave Lett

Intercept the Save event (see "Intercepting events like Save and Print" at
http://word.mvps.org/FAQs/General/index.htm)
In your event(s) you could include something like the following:


With Selection
.HomeKey Unit:=wdStory
With .Find
.ClearFormatting
.Text = ""
.Highlight = True
If .Execute Then
MsgBox "This document has highlighting."
Exit Sub
End If
End With
End With

''' save procedures

HTH,
Dave
 
J

John Doue

Dave said:
Intercept the Save event (see "Intercepting events like Save and Print" at
http://word.mvps.org/FAQs/General/index.htm)
In your event(s) you could include something like the following:


With Selection
.HomeKey Unit:=wdStory
With .Find
.ClearFormatting
.Text = ""
.Highlight = True
If .Execute Then
MsgBox "This document has highlighting."
Exit Sub
End If
End With
End With

''' save procedures

HTH,
Dave
Thanks a million, I'll go for it ...
 

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