TableName Property

       

Returns a String that represents the name of the table within the data source file that contains the mail merge records. The returned value may be blank if the table name is unknown or not applicable to the current data source. Read-only.

expression.TableName

expression   Required. An expression that returns a MailMergeDataSource object.

Example

This example displays a message with the name of the mail merge data source table name.

Sub EmployeeTable()
    With ActiveDocument.MailMerge.DataSource
        Select Case .TableName
            Case "Employees"
                MsgBox "This is an Employee mail merge publication."
            Case "Customers"
                MsgBox "This is a Customers mail merge publication."
            Case "Suppliers"
                MsgBox "This is a Suppliers mail merge publication."
            Case "Shippers"
                MsgBox "This is a Shippers mail merge publication."
            Case Else
                MsgBox "This s a " & .TableName & " mail merge publication."
        End Select
    End With
End Sub