WORKAROUND
Microsoft provides programming examples for illustration only, without warranty either
expressed or implied, including, but not limited to, the implied warranties of
merchantability and/or fitness for a particular purpose. This article assumes
that you are familiar with the programming language being demonstrated and the
tools used to create and debug procedures. Microsoft support professionals can
help explain the functionality of a particular procedure, but they will not
modify these examples to provide added functionality or construct procedures to
meet your specific needs. If you have limited programming experience, you may
want to contact a Microsoft Certified Partner or the Microsoft fee-based
consulting line at (800) 936-5200. For more information about Microsoft Certified
Partners, please visit the following Microsoft Web site:
For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:
To avoid this problem, reset the XE or TC fields to the default formatting.
To do this, use any of the following methods.
Method 1:
Select the XE or TC field and press CTRL+SPACEBAR. This forces the
character formatting to return to the default of the current style.
Method 2:
Use a macro to automate this process. The following macro resets each of
the XE fields in the document. Use this macro to reset direct formatting
that affects your index.
Sub MAIN
Dim TOV As ToolsOptionsView
GetCurValues TOV
If TOV.ShowAll = 0 Then
ToolsOptionsView .ShowAll = 1
Change$ = "yes"
End If
EditBookmark .Name = "ClearFormats", .Add
StartOfDocument
EditFind .Find = "^d XE", .Direction = 0, .MatchCase = 0,
.WholeWord = 0, .PatternMatch = 0, .SoundsLike = 0, .Format =
0, .Wrap = 1
While EditFindFound()
ResetChar
EditFind
Wend
StartOfDocument
EditFind .Find = "^dXE", .Direction = 0, .MatchCase = 0,
.WholeWord = 0, .PatternMatch = 0, .SoundsLike = 0, .Format =
0, .Wrap = 1
While EditFindFound()
ResetChar
EditFind
Wend
EditSelectAll
UpdateFields
EditGoTo .Destination = "ClearFormats"
If Change$ = "yes" Then ToolsOptionsView .ShowAll = 0
End Sub
Method 3:
Use the following macro to remove the direct formatting applied to each of
the TC fields and then update the table of contents:
Sub MAIN
Dim TOV As ToolsOptionsView
GetCurValues TOV
If TOV.ShowAll = 0 Then
ToolsOptionsView .ShowAll = 1
Change$ = "yes"
End If
EditBookmark .Name = "ClearFormats", .Add
StartOfDocument
EditFind .Find = "^d TC", .Direction = 0, .MatchCase = 0,
.WholeWord = 0, .PatternMatch = 0, .SoundsLike = 0, .Format =
0, .Wrap = 1
While EditFindFound()
ResetChar
EditFind
Wend
StartOfDocument
EditFind .Find = "^dTC", .Direction = 0, .MatchCase = 0,
.WholeWord = 0, .PatternMatch = 0, .SoundsLike = 0, .Format =
0, .Wrap = 1
While EditFindFound()
ResetChar
EditFind
Wend
EditFind .Find = "^19 toc"
SendKeys "{F9}%e{enter}"
EditGoTo .Destination = "ClearFormats"
If Change$ = "yes" Then ToolsOptionsView .ShowAll = 0
End Sub