John
Sat May 28 09:22:25 CDT 2005
Jay Freedman wrote:
> John Doue wrote:
>
>>I would like to write a macro warning me if when I open or save a
>>document, this document contains hidden text. How do I detect hidden
>>text in a macro?
>>
>>Thanks
>
>
> Put this in Normal.dot or another global template (see
>
http://www.gmayor.com/installing_macro.htm):
>
> Sub AutoOpen()
> Dim oRg As Range
> Set oRg = ActiveDocument.Range
> ActiveWindow.View.ShowHiddenText = True
> With oRg.Find
> .Format = True
> .Forward = True
> .Font.Hidden = True
> If .Execute Then
> oRg.Select
> With ActiveWindow.View
> .ShowHiddenText = False
> .ShowAll = True
> End With
> MsgBox "Hidden text!"
> Else
> ActiveWindow.View.ShowHiddenText = False
> End If
> End With
> End Sub
>
Jay,
I just changed ShowhiddentText to True and ShowAll to false, and now, it
works. Thanks again.
--
John Doue