Word2003/VBA: {INDEX} field section breaks – not wanted

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15615
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Word2003/VBA: {INDEX} field section breaks – not wanted

Post by ChrisGreaves »

[UPDATED] Panic off, I think. The section breaks seem to be generated automatically if the \C columns) switch is present, regardless of its value.
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
And from the Word2003 Help files (just when I thought I knew everything about {INDEX} I learn that I can right-align page numbers; I saw nothing in the various \Switches about that! Likewise “AccentedLetters” and “SortBy”.

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
You do not have the required permissions to view the files attached to this post.
There's nothing heavier than an empty water bottle