Publisher) (MailMergeDataField 物件
代表資料來源中的單一合併列印欄位。 MailMergeDataField 物件是 MailMergeDataFields 成員 集合。 MailMergeDataFields 集合包含所有的資料欄位中的合併列印或型錄合併列印資料來源 (例如名稱、 地址及縣/市)。
註解
您無法將欄位新增至 MailMergeDataFields 集合。 資料來源中的所有資料欄位會自動都包含在 MailMergeDataFields 集合。
使用 MailMergeDataSource.DataFields (索 引) ,其中 index 是資料欄名或索引編號,可傳回單一 MailMergeDataField 物件。 該索引編號代表資料欄位在合併列印資料來源中的位置。
範例
This example retrieves the name of the first field and value of the first record of the FirstName field in the data source attached to the active publication.
Sub GetDataFromSource()
With ActiveDocument.MailMerge.DataSource
MsgBox "Field Name: " & .DataFields.Item(1).Name & _
"Value: " & .DataFields.Item("FirstName").Value
End With
End Sub
方法
屬性
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。