帮助中心

# open-打开

调用open函数打开指定的Word文档并获取Word文档实例。

最小支持版本:5.0.0

# 语法

WordAction.open(<filepath>, <created>, <visible>, <readOnly>, <password>, <alerts>)
1
WordAction.打开(<filepath>, <created>, <visible>, <readOnly>, <password>, <alerts>)
1

# 函数类型

静态函数

# 请求参数

参数名称 类型 是否必选 默认值 示例值 描述
filepath Cube.Lang.String "C:\Users\Administrator\Desktop\Test\word\test.docx" 待打开Word文档文件路径。
created Cube.Lang.Boolean true false 待打开Word文档文件不存在时是否新建。取值:
true: 新建
false: 不新建
visible Cube.Lang.Boolean true true 是否通过可视化打开。取值:
true: 通过可视化打开
false: 不通过可视化打开
readOnly Cube.Lang.Boolean true false 是否以只读方式打开文档。取值:
true: 通过只读方式打开
false: 通过待打开Word文档的原始模式打开
password Cube.Lang.String "" 待打开Word文档的密码。
若无密码, 则填入空字符串。
alerts Cube.Lang.Boolean true false 是否允许弹窗警告。取值:
true: 允许警告弹窗
false: 不允许警告弹窗

# 返回参数

参数名称 类型 示例值 描述
Result Cube.App.Word.WordDocument Cube.App.Word.WordDocument 获取到的Word文档实例。

# 请求示例

WordAction.open("C:\\Users\\Administrator\\Desktop\\Test\\word\\test.docx", false, true, false, "", false)
1
最近更新时间: { "value": "2023-09-12", "effect": true }