Bookmark content controls
HI I have 49ish content controls embedded in multiple tables. I have to reference all content controls in all three tables for a 4th "scoring" table. The content controls are the full gambit, text, checkboxes, dropdown, list, nested if statements etc. I've tried the following code but it fails and I'm thinking its because its referencing only rich text content although for the life of me I can't see where this is being referenced. Thinking ...controls.item(i) would capture all content controls. Runtime error 4605 method or property is not available as the current selection partially covers a plain text content control. Help is appreciated.
Sub AddBookmarksAtCC()
Dim ccobjA As ContentControl, i As Integer
For i = 1 To ActiveDocument.ContentControls.Count
Set ccobjA = ActiveDocument.ContentControls.Item(i)
Debug.Print ccobjA.Title
ActiveDocument.Bookmarks.Add ccobjA.Title, ActiveDocument.ContentControls.Item(i).Range
Next i
End Sub
|