GroupContentControl Interface
Represents a protected region of a document that users cannot edit or delete.
Assembly: Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)
| Name | Description | |
|---|---|---|
![]() | Application | Gets a Microsoft.Office.Interop.Word::Application that represents the current instance of Microsoft Office Word. |
![]() | BindingContext | (Inherited from IBindableComponent.) |
![]() | Container | This API supports the product infrastructure and is not intended to be used directly from your code. (Inherited from ContentControlBase.) |
![]() | ContainerComponent | This API supports the product infrastructure and is not intended to be used directly from your code. (Inherited from ContentControlBase.) |
![]() | Creator | Gets a 32-bit integer that indicates the application in which the GroupContentControl was created. |
![]() | DataBindings | (Inherited from IBindableComponent.) |
![]() | DefaultDataSourceUpdateMode | Gets or sets the default DataSourceUpdateMode for the ContentControlBase.(Inherited from ContentControlBase.) |
![]() | ID | Gets a unique number that identifies the content control.(Inherited from ContentControlBase.) |
![]() | InnerObject | Gets the underlying Microsoft.Office.Interop.Word::ContentControl object for the Microsoft.Office.Tools.Word::ContentControlBase.(Inherited from ContentControlBase.) |
![]() | LockContentControl | Gets or sets a value that specifies whether the GroupContentControl can be deleted from the document. |
![]() | Parent | Gets the parent of the GroupContentControl. |
![]() | ParentContentControl | Gets the parent content control of a GroupContentControl that is nested in another content control. |
![]() | Range | Gets a Range that represents the contents of the GroupContentControl. |
![]() | Site | (Inherited from IComponent.) |
![]() | Tag | Gets or sets a string that you want to associate with the GroupContentControl. |
![]() | Text | Gets the text in the GroupContentControl. |
![]() | Title | Gets or sets the title of the GroupContentControl. |
| Name | Description | |
|---|---|---|
![]() | BeginInit() | (Inherited from ISupportInitialize.) |
![]() | Copy() | Copies the GroupContentControl from the document to the Clipboard. |
![]() | Cut() | Removes the GroupContentControl from the document and adds it to the Clipboard. |
![]() | Delete(Boolean) | Deletes a dynamically created content control from the document and removes it from the ControlCollection in the document.(Inherited from ContentControlBase.) |
![]() | Dispose() | (Inherited from IDisposable.) |
![]() | EndInit() | (Inherited from ISupportInitialize.) |
| Name | Description | |
|---|---|---|
![]() | Added | Occurs after the content control is added to the document. (Inherited from ContentControlBase.) |
![]() | BindingContextChanged | Occurs when the value of the BindingContext property of the ContentControlBase changes.(Inherited from ContentControlBase.) |
![]() | ContentUpdating | Occurs just before Microsoft Office Word updates the text in the content control, if the content control is bound to a custom XML part.(Inherited from ContentControlBase.) |
![]() | Deleting | Occurs just before the content control is deleted from the document.(Inherited from ContentControlBase.) |
![]() | Disposed | (Inherited from IComponent.) |
![]() | Entering | Occurs when the user clicks in the content control, or when the cursor is moved into the content control programmatically.(Inherited from ContentControlBase.) |
![]() | Exiting | Occurs when the user clicks outside the content control, or when the cursor is moved outside the content control programmatically.(Inherited from ContentControlBase.) |
![]() | StoreUpdating | Occurs just before Microsoft Office Word updates data in a custom XML part that is bound to the content control (that is, after the text in the content control changes).(Inherited from ContentControlBase.) |
![]() | Validated | Occurs when the content control has been successfully validated.(Inherited from ContentControlBase.) |
![]() | Validating | Occurs when the contents of the content control are being validated. (Inherited from ContentControlBase.) |
Use a GroupContentControl to define a protected region of a document that users cannot edit or delete. A GroupContentControl can contain any document items, such as text, tables, graphics, and even other content controls. A GroupContentControl provides no UI that is visible to the user. For more information about using a GroupContentControl to protect a part of a document, see Content Controls and How to: Protect Parts of Documents by Using Content Controls.
Note |
|---|
This interface is implemented by the Visual Studio Tools for Office runtime. It is not intended to be implemented in your code. For more information, see Visual Studio Tools for Office Runtime Overview. |
The GroupContentControl is one of eight types of content controls that you can use to design documents and templates in Microsoft Office Word. Content controls have a user interface (UI) that has controlled input like a form. You can use content controls to prevent users from editing protected sections of the document or template, and you can also bind content controls to a data source. For more information, see Content Controls.
This documentation describes the version of this type that is used in Office projects that target the .NET Framework 4 or later. In projects that target the .NET Framework 3.5, this type might have different members and the code examples provided for this type might not work. For documentation about this type in projects that target the .NET Framework 3.5, see the following reference section in the Visual Studio 2008 documentation: http://go.microsoft.com/fwlink/?LinkId=160658.
The following code example adds a new paragraph to the beginning of the document, and it creates a new GroupContentControl that contains this paragraph. The GroupContentControl prevents users from editing the text in the paragraph.
This version is for a document-level customization. To use this code, paste it into the ThisDocument class in your project, and call the AddGroupControlAtSelection method from the ThisDocument_Startup method.
This version is for an application-level add-in. To use this code, paste it into the ThisAddIn class in your project, and call the AddGroupControlAtSelection method from the ThisAddIn_Startup method.



