DataFieldIndex Property

Microsoft Word Visual Basic

expression.DataFieldIndex

expression    Required. An expression that returns one of the objects in the Applies To list.

Example

This example maps the PostalAddress1 field in the data source to the wdAddress1 mapped data field. This example assumes that the current document is a mail merge document.

Sub MapField()
    With ThisDocument.MailMerge.DataSource
        .MappedDataFields(wdAddress1).DataFieldIndex = _
            .FieldNames("PostalAddress1").Index
    End With
End Sub