Share via


DocumentBase.GetCrossReferenceItems(Object) Method

Definition

Gets an array of items that can be cross-referenced based on the specified cross-reference type.

public:
 System::Object ^ GetCrossReferenceItems(System::Object ^ % referenceType);
public object GetCrossReferenceItems (ref object referenceType);
member this.GetCrossReferenceItems : obj -> obj
Public Function GetCrossReferenceItems (ByRef referenceType As Object) As Object

Parameters

referenceType
Object

One of the WdReferenceType values that specifies the type of item you want to insert a cross-reference to.

Returns

An array of items that can be cross-referenced based on the specified cross-reference type.

Examples

The following code example uses the GetCrossReferenceItems method to get an array of headings that can be cross-referenced. To use this example, run it from the ThisDocument class in a document-level project.

private void DocumentGetCrossReferenceItems()
{
    object referenceType = Word.WdReferenceType.wdRefTypeHeading;
    this.GetCrossReferenceItems(ref referenceType);
}
Private Sub DocumentGetCrossReferenceItems()
    Me.GetCrossReferenceItems(Word.WdReferenceType.wdRefTypeHeading)
End Sub

Remarks

The array corresponds to the items listed in the For which box in the Cross-reference dialog box.

An item returned by this method can be used as the ReferenceWhich argument for the InsertCrossReference method.

Applies to