For which caption, select the figure/table you’re referring to. For Insert reference to, select Only label and number. For Reference type, select Figure or Table. Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback. On the Insert tab, select Cross-reference. ReferenceKind:=wdPageNumber, ReferenceItem:=myBookmarks(1) InsertCrossReference ReferenceType:=wdRefTypeBookmark, _ GetCrossReferenceItems(wdRefTypeBookmark) Set myRange = ActiveDocument.Range(Start:=0, End:=0) This example inserts at the beginning of the active document a cross-reference to the page that includes the first bookmark in the document. If you specify wdPageNumber for the value of ReferenceKind, you may need to repaginate the document to see the correct cross-reference information. Specifies the string to use as a separator if the SeparateNumbers parameter is set to True. (Use only if the ReferenceType parameter is set to wdRefTypeNumberedItem and the ReferenceKind parameter is set to wdNumberFullContext.) True to use a separator to separate the numbers from the associated text. The number from Level 1 will be inserted between the last 0 and the grey-shaded 2. From the 'Include level number from' dropdown, select level 1. True to insert "above" or "below," depending on the location of the reference item in relation to the cross-reference. Select Level 2, choose the style with which you want to link the numbering (Heading 2, for example) In the 'Enter formatting for number' field type in front of the number (2, grey shading): Number 00. Place the mouse cursor to where you want to insert the figure number. Then, we can insert the figure number into the text, as 'Figure 1'. Similarly, I created Figure 2, named 'This is figure two.'. True to insert the cross-reference as a hyperlink to the referenced item. Now, Figure 1 is created, named 'This is figure one.'. Use the GetCrossReferenceItems method to return a list of item names that can be used with this argument. For all other ReferenceType values, this argument specifies the item number or name in the Reference type option in the Cross-reference dialog box. If ReferenceType is wdRefTypeBookmark, this argument specifies a bookmark name. The information to be included in the cross-reference.
You can also determine the cross-reference format, such as Page Number Only or Full Paragraph & Page Number. Can be any WdReferenceType or WdCaptionLabelID constant or a user defined caption label. You can specify whether a cross-reference derives from a paragraph style, such as a heading style, or from a text anchor you’ve created. The type of item for which a cross-reference is to be inserted.
A variable that represents a Range object. InsertCrossReference( _ReferenceType_, _ReferenceKind_, _ReferenceItem_, _InsertAsHyperlink_, _IncludePosition_, _SeparateNumbers_, _SeparatorString_ )Įxpression Required. the word 'figure'), highlight it, add a link with the url #fig_heights.Inserts a cross-reference to a heading, bookmark, footnote, or endnote, or to an item for which a caption label is defined (for example, an equation, figure, or table). The figure number will initially be the same as the first one. So to refer to our graph of heights we would add some text in a paragraph (e.g. Select Level 2, choose the style with which you want to link the numbering (Heading 2, for example) In the 'Enter formatting for number' field type in front of the number (2, grey shading): Number 00. What you can do is select and copy the first caption and paste the second one directly underneath. References are the same, but their codes are #equ, #fig, #tab. They are followed by an underscore, then the name. The codes for labels are as follows: #equat, #figur, #table. The name 'heights' is chosen to be meaningful, but any name is fine.
Instead of a URL, add a code recognised by Cross Reference, then an underscore, then your choice of name.įor example, to label a graph of people's heights you would add text underneath the graph, highlight that text, press Ctrl+K to add a link and enter #figur_heights as the URL. In many of the Word documents you write, you may need to refer the reader to another section, an appendix, a table, or a figure, or numbered reference in a References list. Insert labels and references as hyperlinks. The text and style of references and labels can be customised. If one is removed, references to it are highlighted in red in the text.
If their order changes, references update to match. These elements are numbered automatically and references are updated to match. It now also allows users to create labels for any element.
This add-on allows the user to label equations, figures and tables and refer to them within the text.