Compartilhar via


MailMergeDataSource.ConnectString Property

Word Developer Reference

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.

Visual Basic for Applications
  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