Syntax
InsertCrossReference [.ReferenceType = text] [, .ReferenceKind = text] [, .ReferenceItem = text]
Remarks
Inserts a cross-reference to a heading, bookmark, footnote, endnote, or an item for which a caption label is defined (for example, an equation, figure, or table). The arguments for the InsertCrossReference statement correspond to the options in the Cross-reference dialog box (Insert menu).
Argument | Explanation |
.ReferenceType | The type of item to which you want to insert a cross-reference, as it appears in the Reference Type box. |
Argument | Explanation |
.ReferenceKind | A number specified as text corresponding to the information you want the cross-reference to include. See the following table for available values. |
.ReferenceItem | If .ReferenceType is "Bookmark", a bookmark name. For all other reference types, a number specified as text corresponding to an item in the For Which [Reference Type] box: "1" corresponds to the first item, "2" corresponds to the second item, and so on. |
The following table shows the values available for .ReferenceKind based on the setting for .ReferenceType.
.ReferenceType | Values available for .ReferenceKind |
Heading | 0 (zero) Heading Text 7 Page Number 8 Heading Number |
Bookmark | 1 Bookmark Text 7 Page Number 9 Paragraph Number |
Footnote | 5 Footnote Number 7 Page Number |
Endnote | 6 Endnote Number 7 Page Number |
An item for which a caption label is defined | 2 Entire Caption 3 Only Label And Number 4 Only Caption Text 7 Page Number |
Example
This example inserts a sentence containing two cross-references to a diagram: one to the caption and another to the page containing the diagram. A typical sentence inserted with these instructions might be, "For a diagram of a widget, see 'Figure 1: Standard Widget' on page 5."
Insert "For a diagram of a widget, see " + Chr$(34) InsertCrossReference .ReferenceType = "Figure", \ .ReferenceKind = "2", .ReferenceItem = "1" Insert Chr$(34) + " on page " InsertCrossReference .ReferenceType = "Figure", \ .ReferenceKind = "7", .ReferenceItem = "1" Insert "."
See Also
InsertCaption