Table of contents
Collapse the table of content
Expand the table of content

OfficeDataSourceObject.Table Property (Office)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Gets 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. Table

expression A variable that represents an OfficeDataSourceObject object.


This example sets the name of the table if the table name is currently blank.

Sub OfficeTest() 

 Dim appOffice As OfficeDataSourceObject 

 Set appOffice = Application.OfficeDataSourceObject 
 appOffice.Open bstrConnect:="DRIVER=SQL Server;SERVER=ServerName;" & _ 
 "UID=user;PWD=;DATABASE=Northwind", bstrTable:="Employees" 

 If appOffice.Table = "" Then 
 appOffice.Table = "Employees" 
 End If 

End Sub 

See also


OfficeDataSourceObject Object

Other resources

OfficeDataSourceObject Object Members

© 2018 Microsoft