Different Types
Group | Represents a protected region that users cannot edit or delete. This is not a control for grouping other content controls. |
Can contain other content controls plus other word objects, tables, graphics etc | |
can be used to group content controls together and other document content to protect it from editing or deletion. | |
allows you to protect an area of the document without having to apply protection to the whole document | |
Can contain other content controls although problems found when adding no editable content controls into groups and then PDF'ing | |
provides an easy way to protect document content when it is combined with editable custom controls | |
when you hover over a group with the mouse the area will be highlighted | |
when the cursor is placed insode a group control a border is displayed around the area | |
Rich Text | Formatting can be saved by loading, saving or closing the document. Use for short paragraphs. There are no restrictions |
can contain text in multiple styles | |
can contain other content controls | |
Microsoft.Office.Tools.Word.RichTextContentControl | |
Text | Limited to content that has no formatting. Only plain text. The format is determined by the formatting around the content control |
can only contain text in one style | |
cannot contain other content controls | |
Microsoft.Office.Tools.Word.PlainTextContentControl | |
Picture | Fills the control with a single picture |
Fills the content control with a single picture. Limits formatting changes to picture brightness and contrast. | |
Can display pictures in several different formats | |
cannot contain other content controls | |
Combo Box | Contains a list that you can edit. Formatting can be saved by saving or closing the document |
Can be arbitrary text or a value selected from a drop-down | |
can only contain text in one style | |
cannot contain other content controls | |
Drop-Down List | Contains a list of restricted choices |
Contains a list of restricted choices defined by the template. Text is restricted to a single paragraph with no formatting. no restriction on the number of items | |
can only be a value selected from a drop-down | |
can only contain text in one style | |
cannot contain other content controls | |
Date Picker | Contains a calendar control, limits text to a single paragraph |
Can be arbitrary text or date selected from a drop-down date picker | |
can only contain text in one style | |
Building Block Gallery | Shows a gallery of formatted designs Use this to specify a set of cover pages, headers, page designs or other building blocks from the Quick Parts gallery |
allows the user to choose a specific building block Shows a gallery of formatted choices. | |
can contain text in multiple styles | |
can contain other content controls | |
can select items from a drop-down that displays items from existing galleries built-in to Word or from custom template | |
CheckBox | (Added in 2013) - If this control is opened up in Word 2007 it is displayed in a RichText control |
There is no CheckBoxContentControl type | |
To create a checkbox you need to use: | |
this.Controls.AddContentControl("name",Word.wdContentControlType.wdContentControlCheckBox); | |
Repeating Section | (Added in 2013) |
Properties
Text - get or set the text that is displayed in the control
PlaceholderText - get or set the temporary text that is displayed in the control until a user edits the control
Title - get or set the title that is displayed in the border of the content control when the user clicks on it
Temporary - remove the control from the document automatically after the user edits the control. The text in the control remains in the document
LockControls - prevents users from editing the control
LockContentControl - prevents users from deleting the control
Events
Entering - ContentControlOnEnter - runs when the user clicks in the content control or when the cursor is moved into the content control programmatically.
Exiting - ContentControlOnExit - runs when the user clicks outside the content control or when the cursor is moved outside the content control pgrammatically
Added - ContentControlAfterAdd - runs when the content control is added to the document as a result of a redo or undo operations.
Deleting - ContentControlBeforeDelete - runs just before the content control is deleted from the document
© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext