MappedDataField.DataFieldIndex Property

Word Developer Reference

Returns or sets a Long that represents the corresponding field number in the mail merge data source to which a mapped data field maps. Read/write.

Syntax

expression.DataFieldIndex

expression   A variable that represents a MappedDataField object.

Remarks

This property returns zero if the specified data field is not mapped to a mapped data field.

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.

Visual Basic for Applications
  Sub MapField()
    With ActiveDocument.MailMerge.DataSource
        .MappedDataFields(wdAddress1).DataFieldIndex = _
            .FieldNames("PostalAddress1").Index
    End With
End Sub

See Also