Skip to content

Latest commit

 

History

History
89 lines (68 loc) · 3 KB

Publisher.MailMergeDataSource.md

File metadata and controls

89 lines (68 loc) · 3 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
MailMergeDataSource object (Publisher)
vbapb10.chm6356991
vbapb10.chm6356991
Publisher.MailMergeDataSource
a02eb4fb-7db7-e533-c3ca-95bc4ca68e82
05/31/2019
medium

MailMergeDataSource object (Publisher)

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

Remarks

Use the MailMerge.DataSource property to return the MailMergeDataSource object.

Example

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

Properties

See also

[!includeSupport and feedback]