ConnectString Property

Microsoft Publisher Visual Basic

expression.ConnectString

expression    Required. An expression that returns a MailMergeDataSource object.

Example

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

Sub VerifyCorrectDataSource()

    With ActiveDocument.MailMerge.DataSource
        If InStr(.ConnectString, "OLEDB") > 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