Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get a list of captions?

Status
Not open for further replies.

hstijnen

Programmer
Nov 13, 2002
172
NL
Hi,
I would like to make a form for cross referencing to tables (using Word 2000). I've made such
form for headings and used the code:
Code:
   myHeadings = ActiveDocument.GetCrossReferenceItems(wdRefTypeHeading)
giving an array with all headings in the document.

Is there a corresponding argument for (table) captions?

In Help for GetCrossReferenceItems are only mentioned wdRefTypeBookmark, wdRefTypeEndnote,
wdRefTypeFootnote, wdRefTypeHeading, wdRefTypeNumberedItem. However, in
method InsertCrossReference I see for argument ReferenceType the constant
wdCaptionTable. There should be a corresponding argument for
GetCrossReferenceItems to get all Captions. But I don't see it in Help.

Thanks for help
Regards,
Henk

 
Take a look at CaptionLabels

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
CaptionLabels seems to give a collection of label categories, initial "figure", "table" and "equation", for which one can set e.g. the numbering style.

What I try to get is the list of all captions belonging to the tables in my document, in order to select one to create a cross reference

Thanks for help
Henk
 
Hi Henk,

It works for me - I know it isn't in Help but have you tried it? (wdCaptionTable has a value of -2).

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Thanks Tony,
Indeed it works:
ActiveDocument.GetCrossReferenceItems(wdCaptionTable)
gives me the desired list.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top