DocumentBase.GetCrossReferenceItems Method

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

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Syntax

'Declaration
Public Function GetCrossReferenceItems ( _
    ByRef referenceType As Object _
) As Object
public Object GetCrossReferenceItems(
    ref Object referenceType
)

Parameters

  • referenceType
    Type: System.Object%

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

Return Value

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

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.

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 Sub DocumentGetCrossReferenceItems()
    Me.GetCrossReferenceItems(Word.WdReferenceType.wdRefTypeHeading)
End Sub
private void DocumentGetCrossReferenceItems()
{
    object referenceType = Word.WdReferenceType.wdRefTypeHeading;
    this.GetCrossReferenceItems(ref referenceType);
}

.NET Framework Security

See Also

Reference

DocumentBase Class

Microsoft.Office.Tools.Word Namespace