Chris
How to remove section break continues in MS Word?
Problem with section breaks
How can I stop Word2003/VBA from inserting Section Breaks around an Inserted {INDEX} field?
My Word2003/VBA code to insert an {INDEX} field is shown below. It works, but insists on introducing a section-break before and after the {INDEX}. I want to remove this section break, which I can do by VBA coding around the Range of the {INDEX} after it has been inserted.
Here is the procedure in use:
Code: Select all
Function InsertIndexField(osLocal As Indxr.typOptionsStructure)
Dim strINDEXSwitches As String
With osLocal
strINDEXSwitches = strAppend(strINDEXSwitches, "\c", .strColumns)
strINDEXSwitches = strAppend(strINDEXSwitches, "\h", .strHeading)
strINDEXSwitches = strAppend(strINDEXSwitches, "\l", .strLSeparator)
strINDEXSwitches = strAppend(strINDEXSwitches, "\p", .strPRange)
End With
Selection.EndKey (wdStory)
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:="INDEX " & strINDEXSwitches, PreserveFormatting:=True
End Function
It is these features documented in Help but not in Switches that causes me to ask if there is anything I have missed about the section breaks.
I can’t think of a rational reason for requiring section breaks. Wanting them, yes; but Needing them, no.
Thanks
Chris