![]() Gets or sets the default DataSourceUpdateMode for the ContentControlBase. Gets a 32-bit integer that indicates the application in which the GroupContentControl was created. Gets a Application that represents the current instance of Microsoft Office Word. NET Framework 3.5, see the following reference section in the Visual Studio 2008 documentation. For documentation about this type 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. This documentation describes the version of this type that is used in Office projects that target the. For more information, see Content Controls. 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. ![]() Content controls have a user interface (UI) that has controlled input like a form. The GroupContentControl is one of eight types of content controls that you can use to design documents and templates in Microsoft Office Word. For more information, see Visual Studio Tools for Office Runtime Overview. It is not intended to be implemented in your code. This interface is implemented by the Visual Studio Tools for Office runtime. 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. A GroupContentControl provides no UI that is visible to the user. A GroupContentControl can contain any document items, such as text, tables, graphics, and even other content controls. Use a GroupContentControl to define a protected region of a document that users cannot edit or delete. VstoDoc.Paragraphs(1).Range.Text = "You cannot edit or change the formatting of text " & _ VstoDoc.Paragraphs(1).Range.InsertParagraphBefore() If Me.Application.ActiveDocument Is Nothing Thenĭim vstoDoc As Document = (Me.Application.ActiveDocument) private .GroupContentControl groupControl1 To use this code, paste it into the ThisAddIn class in your project, and call the AddGroupControlAtSelection method from the ThisAddIn_Startup method. This version is for an application-level add-in. GroupControl1 = Me.Controls.AddGroupContentControl("groupControl1") "in this paragraph, because this paragraph is in a GroupContentControl." Me.Paragraphs(1).Range.Text = "You cannot edit or change the formatting of text " & _ Me.Paragraphs(1).Range.InsertParagraphBefore() GroupControl1 = ("groupControl1") ĭim groupControl1 As .GroupContentControl Range1.Text = "You cannot edit or change the formatting of text " + ![]() Private void AddGroupControlAtSelection() 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 a document-level customization. The GroupContentControl prevents users from editing the text in the paragraph. The following code example adds a new paragraph to the beginning of the document, and it creates a new GroupContentControl that contains this paragraph. ContentControlBase IComponent ISupportInitialize IDisposable IBindableComponent Examples
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |