ConnectString Property

Applies To

MailMergeDataSource object.

Description

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

See Also

OpenDataSource method.

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.

Set myDoc = Documents.Add
With myDoc.MailMerge
    .MainDocumentType = wdFormLetters
    .OpenDataSource Name:="C:\MSOffice\Access\Samples\Northwind.mdb", _
        LinkToSource:=True, AddToRecentFiles:=False, _
        Connection:="TABLE Customers
    MsgBox .DataSource.ConnectString
End With