MailMergeDataSource.TableName Property
Word Developer Reference |
Returns a String with the SQL query used to retrieve the records from the data source file attached to a mail merge document. Read-only.
Syntax
expression.TableName
expression A variable that represents a MailMergeDataSource object.
Remarks
This property may be blank if the table name is unknown or not applicable to the current data source.
Example
This example checks to see if the Customers table is the name of the table in the attached data source. If not, it attaches the Customers table in the Northwind database.
Note |
---|
This example uses the Visual Basic InStr function, which returns the position of the first character in the second string if it exists in the first string. A value of zero (0) is returned if the first string does not contain the second string. Setting the conditional value to less than one (1) indicates that the attached table is not named Customers. |
Visual Basic for Applications |
---|
|
See Also