内容控件
获取文档内容控件的数量
/*
* @return: number
*/
let ContentControlsCount = await demo.WordApplication().ActiveDocument.ContentControls.Count
获取内容控件指定属性(Title, Tag, PlaceholderText)
/*
* @return: string
*/
let contentTitle = await demo.WordApplication().ActiveDocument.ContentControls.Item(0).Title
// or
let contentTag = await demo.WordApplication().ActiveDocument.ContentControls.Item(0).Tag
// or
let contentPlaceholderText = await demo.WordApplication().ActiveDocument.ContentControls.Item(0).PlaceholderText
设置内容控件指定属性(Title, Tag, PlaceholderText)
/*
* @param: string
*/
// 获取第一个控件的指定属性
let text = 'webOffice demo'
demo.WordApplication().ActiveDocument.ContentControls.Item(0).Title = text
demo.WordApplication().ActiveDocument.ContentControls.Item(0).Tag = text
demo.WordApplication().ActiveDocument.ContentControls.Item(0).SetPlaceholderText(text)