在Word表格单元格中查找内容控件

huangapple go评论78阅读模式
英文:

Finding content controls within Word table cells

问题

我基本上正在遍历给定的Word文档中所有表格中的所有单元格。我希望能够识别包含ContentControls的单元格。这可能吗?

至少在文本长度方面,只包含ContentControls的单元格似乎为空(除了正常的两个单元格结束字符)。

英文:

I am basically looping through all the cells within all the tables of a given Word document. I want to be able to identify cells that contain ContentControlls. Is this possible?

At least in terms of text length, cells with only ContentControls appear to be empty (other than the normal two cell end characters)

答案1

得分: 1

例如:

Dim c As Cell

Set c = ActiveDocument.tables(1).Cell(3,3)
Debug.Print c.Range.ContentControls.Count
英文:

For example:

Dim c As Cell

Set c = ActiveDocument.tables(1).Cell(3,3)
Debug.Print c.Range.ContentControls.Count

huangapple
  • 本文由 发表于 2023年7月28日 06:15:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/76783725.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定