N
nerfemail
Hi,
I need your help. I spent many hours and have not found a solution for
my problem.
I have a big word 2003 document. It has many headings (up to 5+ levels
deep). It also has bullets (lists).
I found a piece of code, that lets me place all the headings in a
listbox, but I don't know how to select the current (cursor) heading
in the listbox.
I tried to get the current heading text, but some heading titles
contain the same text.
Is it possible to get the heading ID? So that I can use
listbox1.listindex=HeadingID? Can you help?
Thank you
POPULATING THE LISTBOX:
varRefType = WdReferenceType.wdRefTypeHeading
varXRefs =
ActiveDocument.GetCrossReferenceItems(ReferenceType:=varRefType)
For Index = 1 To UBound(varXRefs)
Me.ListBox1.AddItem varXRefs(Index)
Next Index
DOCUMENT:
1 HEADING ONE TITLE
- bullet list
1.1 HEADING TITLE
* mouse cursor is here (should select this entry when adding to
listbox)
2 HEADING TITLE
etc.
I need your help. I spent many hours and have not found a solution for
my problem.
I have a big word 2003 document. It has many headings (up to 5+ levels
deep). It also has bullets (lists).
I found a piece of code, that lets me place all the headings in a
listbox, but I don't know how to select the current (cursor) heading
in the listbox.
I tried to get the current heading text, but some heading titles
contain the same text.
Is it possible to get the heading ID? So that I can use
listbox1.listindex=HeadingID? Can you help?
Thank you
POPULATING THE LISTBOX:
varRefType = WdReferenceType.wdRefTypeHeading
varXRefs =
ActiveDocument.GetCrossReferenceItems(ReferenceType:=varRefType)
For Index = 1 To UBound(varXRefs)
Me.ListBox1.AddItem varXRefs(Index)
Next Index
DOCUMENT:
1 HEADING ONE TITLE
- bullet list
1.1 HEADING TITLE
* mouse cursor is here (should select this entry when adding to
listbox)
2 HEADING TITLE
etc.