Call this subroutine from your utility before you save as HTML to delete all
the text that has the Hidden property:
Dim bShowHidden As Boolean
bShowHidden = ActiveWindow.View.ShowHiddenText
ActiveWindow.View.ShowHiddenText = True
.Font.Hidden = True
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
ActiveWindow.View.ShowHiddenText = bShowHidden
It doesn't matter whether or not the document has any Hidden text -- if
there isn't any, the macro will have no effect.
Notice that the Hidden text must be visible for the .Find to work.
When you close the original document, do it this way to avoid saving the
Microsoft Word MVP Word MVP FAQ site: http://www.mvps.org/word
> I've written a utility which simply opens word docs and saves them in HTML
> format using automation.
> I've come accross some docs that have "Hidden Text" which then shows up in
> the resulting HTML doc format.
> Is there a quick way to remove all hidden text from a doc or a
> setting/option that will cause the hidden text NOT to be saved?