跳到主要内容

移除字段包装器

移除字段包装器,仅保留字段内容。

语法

expression.RemoveFieldWrapper(fieldId);

expression - 表示 Api 类的变量。

参数

名称必填/选填数据类型默认值说明
fieldId选填string字段 ID。如果未指定,则移除当前字段的包装器。

返回值

此方法不返回任何值。

示例

window.Asc.plugin.executeMethod("GetAllAddinFields", null, function(fields) {
let count = 0;
fields.forEach(function(field) {
if (field.Value.includes(bibPrefix) || field.Value.includes(citPrefix)) {
count++;
window.Asc.plugin.executeMethod("RemoveFieldWrapper", [field.FieldId], function() {
count--;
if (!count)
window.Asc.plugin.executeCommand("close", "");
});
}
});

if (!fields.length)
window.Asc.plugin.executeCommand("close", "");
});