Export (0) Print
Expand All

MailMergeDataSource.ConnectString Property

Office 2007
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(.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



Community Additions

ADD
Show:
© 2015 Microsoft