Share via


MailMergeDataSource.ConnectString Property

Publisher Developer Reference

Returns a String that represents the connection to the specified mail merge data source. Read-only.

Syntax

expression.ConnectString

expression   A variable that represents a MailMergeDataSource object.

Return Value
String

Example

This example checks if the connection string contains the characters OLEDB and displays a message accordingly.

Visual Basic for Applications
  Sub VerifyCorrectDataSource()
With ActiveDocument.MailMerge.DataSource
    If InStr(.<strong>ConnectString</strong>, "OLEDB") &gt; 0 Then
        MsgBox "OLE DB is used to connect to the data source."
    Else
        MsgBox "OLE DB is not used to connect to the data source."
    End If
End With

End Sub

See Also