D
David Turner
I'm trying to check whether files contain certain font attributes (hidden,
smallcaps, etc.) anywhere within the whole document or in its sections but
the code below seems to return wdUndefined (9999999) irrespective of whether
the document has any hidden text or no at all.
Strangely enough, it works for short test documents but when I try it on a
"real" document 20 or 30 pages long, it always returns .Font.Hidden = 9999999
even though running a Find for hidden text shows that the document has no
text with hidden font..
It also fails at Section level but works properly at Paragraph level.
Is this a bug or am I doing something wrong?
Many thanks.
David
Sub CheckForHidden()
Dim rDoc As Range
Set rDoc = ActiveDocument.Range
With rDoc
Select Case .Font.Hidden
Case 0
MsgBox "none of the text is hidden"
Case -1
MsgBox "all of the text is hidden"
Case Else
MsgBox "some of the text is hidden"
End Select
End With
End Sub
smallcaps, etc.) anywhere within the whole document or in its sections but
the code below seems to return wdUndefined (9999999) irrespective of whether
the document has any hidden text or no at all.
Strangely enough, it works for short test documents but when I try it on a
"real" document 20 or 30 pages long, it always returns .Font.Hidden = 9999999
even though running a Find for hidden text shows that the document has no
text with hidden font..
It also fails at Section level but works properly at Paragraph level.
Is this a bug or am I doing something wrong?
Many thanks.
David
Sub CheckForHidden()
Dim rDoc As Range
Set rDoc = ActiveDocument.Range
With rDoc
Select Case .Font.Hidden
Case 0
MsgBox "none of the text is hidden"
Case -1
MsgBox "all of the text is hidden"
Case Else
MsgBox "some of the text is hidden"
End Select
End With
End Sub