Selection.InsertCrossReference Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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).
public void InsertCrossReference (ref object ReferenceType, Microsoft.Office.Interop.Word.WdReferenceKind ReferenceKind, ref object ReferenceItem, ref object InsertAsHyperlink, ref object IncludePosition, ref object SeparateNumbers, ref object SeparatorString);
abstract member InsertCrossReference : obj * Microsoft.Office.Interop.Word.WdReferenceKind * obj * obj * obj * obj * obj -> unit
Public Sub InsertCrossReference (ByRef ReferenceType As Object, ReferenceKind As WdReferenceKind, ByRef ReferenceItem As Object, Optional ByRef InsertAsHyperlink As Object, Optional ByRef IncludePosition As Object, Optional ByRef SeparateNumbers As Object, Optional ByRef SeparatorString As Object)
Parameters
- ReferenceType
- Object
Required Object. The type of item for which a cross-reference is to be inserted. Can be any WdReferenceType or WdCaptionLabelID constant or a user defined caption label.
- ReferenceKind
- WdReferenceKind
Required WdReferenceKind. The information to be included in the cross-reference.
- ReferenceItem
- Object
Required Object. If ReferenceType
is wdRefTypeBookmark, this argument specifies a bookmark name. For all other ReferenceType
values, this argument specifies the item number or name in the Reference type box in the Cross-reference dialog box. Use the GetCrossReferenceItems(Object) method to return a list of item names that can be used with this argument.
- InsertAsHyperlink
- Object
Optional Object. True to insert the cross-reference as a hyperlink to the referenced item.
- IncludePosition
- Object
Optional Object. True to insert "above" or "below," depending on the location of the reference item in relation to the cross-reference.
- SeparateNumbers
- Object
Optional Object. True to use a separator to separate the numbers from the associated text. (Use only if the ReferenceType
parameter is set to wdRefTypeNumberedItem and the ReferenceKind
parameter is set to wdNumberFullContext.)
- SeparatorString
- Object
Optional Object. Specifies the string to use as a separator if the SeparateNumbers parameter is set to True.
Remarks
If you specify wdPageNumber for the value of ReferenceKind
, you may need to repaginate the document in order to see the correct cross-reference information.