Поделиться через


MailMergeDataSource.ConnectString Property (Word)

Returns the connection string for the specified mail merge data source. Read-only String.

Syntax

expression .ConnectString

expression A variable that represents a MailMergeDataSource object.

Example

This example creates a new main document and attaches the Customers table from a Microsoft Access database named "Northwind.mdb." The connection string is displayed in a message box.

Dim docNew As Document 
 
Set docNew = Documents.Add 
 
With docNew.MailMerge 
 .MainDocumentType = wdFormLetters 
 .OpenDataSource _ 
 Name:="C:\Program Files\Microsoft Office\Office" & _ 
 "\Samples\Northwind.mdb", _ 
 LinkToSource:=True, AddToRecentFiles:=False, _ 
 Connection:="TABLE Customers" 
 MsgBox .DataSource.ConnectString 
End With

See Also

Concepts

MailMergeDataSource Object Members

MailMergeDataSource Object