MailMergeDataSource.TableName property (Publisher)
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.
Syntax
expression.TableName
expression A variable that represents a MailMergeDataSource object.
Return value
String
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 is a " & .TableName & " mail merge publication."
End Select
End With
End Sub
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.