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

MailMergeDataSource Object (Publisher)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Represents the data source in a mail merge or catalog merge operation.

Example

Use the DataSource property to return the MailMergeDataSource object. The following example displays the name of the data source associated with the active publication.

Sub ShowDataSourceName() 
 If ActiveDocument.MailMerge.DataSource.Name <> "" Then _ 
 MsgBox ActiveDocument.MailMerge.DataSource.Name 
End Sub

The following example tests the open data source associated with the active publication to determine whether the LastName field includes the name Fuller.

Sub FindSelectedRecord() 
 With ActiveDocument.MailMerge 
 If .DataSource.FindRecord(FindText:="Fuller", _ 
 Field:="LastName") = True Then 
 MsgBox "Data was found" 
 End If 
 End With 
End Sub

Methods

Name
ApplyFilter
Close
EditRecord
FindRecord
OpenRecipientsDialog
SetAllErrorFlags
SetAllIncludedFlags
SetSortOrder

Properties

Name
ActiveRecord
Application
ConnectString
DataFields
DataSources
EverValidated
Filters
FirstRecord
Included
InvalidAddress
InvalidComments
IsMaster
LastRecord
MappedDataFields
Name
Parent
RecordCount
TableName
Type
ValidatedClean
© 2017 Microsoft