Table of contents
TOC
Collapse the table of content
Expand the table of content

MailMergeDataField.Index Property (Publisher)

office 365 dev account|Last Updated: 8/24/2017
|
3 Contributors

Returns a Long that represents the position of a particular item in a specified collection. .

Syntax

expression. Index

_expression_A variable that represents a MailMergeDataField object.

Example

The following example loops through the MailMergeDataFields collection and displays the Index and Name properties for each field.

Dim mmfLoop As MailMergeDataField 

With ActiveDocument.MailMerge.DataSource 
 If .DataFields.Count > 0 Then 
 For Each mmfLoop In .DataFields 
 Debug.Print "Field " &; mmfLoop.Name _ 
 &; " / Index " &; mmfLoop.Index 
 Next mmfLoop 
 Else 
 Debug.Print "No fields to report." 
 End If 
End With

The following example loops through the Plates collection and displays the Index and Name properties for each plate.

Dim plaLoop As Plate 

If ActiveDocument.Plates.Count > 0 Then 
 For Each plaLoop In ActiveDocument.Plates 
 Debug.Print "Plate " &; plaLoop.Name _ 
 &; " / Index " &; plaLoop.Index 
 Next plaLoop 
Else 
 Debug.Print "No plates to report." 
End If
© 2018 Microsoft