Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Latest commit

 

History

History
56 lines (32 loc) · 1.27 KB

document-isdatasourceconnected-property-publisher.md

File metadata and controls

56 lines (32 loc) · 1.27 KB
title keywords f1_keywords ms.prod api_name ms.assetid ms.date
Document.IsDataSourceConnected Property (Publisher)
vbapb10.chm196722
vbapb10.chm196722
publisher
Publisher.Document.IsDataSourceConnected
b62422ab-12f7-1151-d8d1-1cb32de18160
06/08/2017

Document.IsDataSourceConnected Property (Publisher)

True if the specified publication is connected to a data source. Read-only.

Syntax

expression. IsDataSourceConnected

_expression_A variable that represents an Document object.

Remarks

A publication must be connected to a valid data source to perform a mail merge or catalog merge.

Example

The following example tests whether the publication is connected to a data source and, if it is not, specifies and connects a data source to the publication.

Before running this example, you must replace PathToFile with a valid file path and TableName with a valid data source table name.

Dim strDataSource As String 
Dim strDataSourceTable As String 
 
 'Specify data source and table name 
 
 strDataSource = "PathToFile" 
 strDataSourceTable = "TableName" 
 
 'Connect to a datasource 
 If Not (ThisDocument.IsDataSourceConnected) Then 
 ThisDocument.MailMerge.OpenDataSource strDataSource, , strDataSourceTable 
 
 End If