TextRetrievalMode.IncludeHiddenText property (Word)
True if the text retrieved from the specified range includes hidden text. Read/write Boolean.
Syntax
expression. IncludeHiddenText
expression An expression that returns a 'TextRetrievalMode' object.
Remarks
The default value is the same as the current setting of the Hidden text option on the View tab in the Options dialog box (Tools menu) until this property has been set.
Use the Text property with a Range object to retrieve text from the specified range.
Example
This example displays the text of the first sentence in the active document in a message box. The example uses the IncludeHiddenText property to include hidden text.
Dim rngTemp As Range
Set rngTemp = ActiveDocument.Sentences(1)
rngTemp.TextRetrievalMode.IncludeHiddenText = True
MsgBox rngTemp.Text
This example posts a message if the entire selection is formatted as hidden text.
Dim rngTemp As Range
If Selection.Type = wdSelectionNormal Then
Set rngTemp = Selection.Range
rngTemp.TextRetrievalMode.IncludeHiddenText = False
If rngTemp.Text = "" Then MsgBox "Selection is hidden"
End If
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for