Table of contents
TOC
折叠目录
展开目录

MailMergeDataSource.DataFields 属性 (发布服务器)MailMergeDataSource.DataFields Property (Publisher)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

返回一个MailMergeDataFields集合,代表指定的数据源中的域。Returns a MailMergeDataFields collection that represents the fields in the specified data source.

语法Syntax

表达式DataFieldsexpression. DataFields

_expression_A 表示MailMergeDataSource对象的变量。_expression_A variable that represents a MailMergeDataSource object.

返回值Return Value

MailMergeDataFieldsMailMergeDataFields

示例Example

本示例显示附加到当前出版物的数据源中的当前记录的 FirstName 和 LastName 字段值。This example displays the value of the value of the FirstName and LastName fields from the active record in the data source attached to the active publication.

Sub ShowNameForActiveRecord() 
 Dim mdfFirst As MailMergeDataField 
 Dim mdfLast As MailMergeDataField 

 With ActiveDocument.MailMerge.DataSource 
 Set mdfFirst = .DataFields.Item("FirstName") 
 Set mdfLast = .DataFields.Item("LastName") 
 MsgBox "The active record in the attached " &; _ 
 vbLf &; "data source is : " &; _ 
 mdfFirst.Value &; " " &; _ 
 mdfLast.Value 
 End With 
End Sub
© 2018 Microsoft