Table of contents
TOC
折叠目录
展开目录

Window.Activate 方法 (发布服务器)Window.Activate Method (Publisher)

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

激活窗口或 OLE 对象。Activates a window or OLE object.

语法Syntax

表达式激活expression. Activate

_expression_A 表示一个窗口对象的变量。_expression_A variable that represents a Window object.

返回值Return Value

Nothing

注解Remarks

由于发布服务器运行在一个窗口中,使用Window对象的激活方法使发布服务器活动应用程序。Because Publisher runs in a single window, using the Activate method with a Window object makes Publisher the active application.

示例Example

以下示例使 Publisher 成为活动应用程序。The following example makes Publisher the active application.

Application.ActiveWindow.Activate

以下示例将一个 Excel 电子表格添加到当前出版物的第一页并激活电子表格以进行编辑。The following example adds an Excel spreadsheet to the first page of the active publication and activates the spreadsheet for editing.

Dim shpSheet As Shape 

Set shpSheet = ActiveDocument.Pages(1).Shapes.AddOLEObject _ 
 (Left:=72, Top:=72, ClassName:="Excel.Sheet") 

shpSheet.OLEFormat.Activate
© 2018 Microsoft