Table of contents

OfficeDataSourceObject.Table 属性 (办公室)OfficeDataSourceObject.Table Property (Office)

office 365 dev account|上次更新日期: 2018/3/13
2 参与人员

获取一个字符串,表示数据源文件中包含邮件合并记录的表的名称。返回的值可能为空如果表格名称未知或不适用于当前数据源。只读的。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

表达式_一个表示OfficeDataSourceObject对象的变量。_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 对象OfficeDataSourceObject Object

其他资源Other resources

OfficeDataSourceObject 对象成员OfficeDataSourceObject Object Members

© 2018 Microsoft