Search code examples
vbams-wordcontentcontrolword-table

Finding content controls within Word table cells


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)


Solution

  • For example:

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