DocumentBase::Controls Property
Gets the collection of managed controls that are contained on the document.
Assembly: Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)
Property Value
Type: Microsoft.Office.Tools.Word::ControlCollection^A ControlCollection that contains all the managed controls on the document.
A document in an Office solution can contain Windows Forms controls and host controls. For more information, see Controls on Office Documents.
The following code example adds text to the first paragraph and creates a Bookmark control that encompasses the paragraph. The code then shows a message box that displays the total number of controls on the document. To use this example, run it from the ThisDocument class in a document-level project.
Show: