globalkrot.blogg.se

How to link text boxes word 2016
How to link text boxes word 2016








how to link text boxes word 2016

To add a content control at a specified range RichTextControl1.PlaceholderText = "Enter your first name" RichTextControl1 = Me.Controls.AddRichTextContentControl("richTextControl1") Me.Paragraphs(1).Range.InsertParagraphBefore() Private Sub AddRichTextControlAtSelection() RichTextControl1.PlaceholderText = "Enter your first name" ĭim richTextControl1 As .RichTextContentControl Private void AddRichTextControlAtSelection() private .RichTextContentControl richTextControl1

To run this code, add the code to the ThisDocument class in your project, and call the AddRichTextControlAtSelection method from the ThisDocument_Startup event handler. The following code example uses the AddRichTextContentControl method to add a new RichTextContentControl to the beginning of the document. Use a ControlCollection method that has the name Add (where control class is the class name of the content control that you want to add, such as AddRichTextContentControl), and that has a single parameter for the name of the new control.

how to link text boxes word 2016

To add a content control at the current selection For more information, see Content controls. To add a check box content control to a document in a Word 2010 project, you must create a ContentControl object. For more information, see Add controls to Office documents at run time.

how to link text boxes word 2016

You can recreate a content control that is based on a native content control the next time the document is opened. However, a native content control remains in the document. Each method has three overloads that you can use to add a content control in the following ways:Īdd a control that is based on a native content control in the document.ĭynamically created content controls are not persisted in the document when the document is closed. You can add content controls programmatically to your document at run time by using methods of the Controls property of the ThisDocument class in your project. In the Controls group, click the icon for the content control that you want to add. For more information, see How to: Show the Developer tab on the Ribbon. If the Developer tab is not visible, you must first show it. For more information, see How to: Populate documents with data from objects and How to: Populate documents with data from a database. This is useful when you want to bind the control to data when the control is created. There are several ways to add content controls to the document in a document-level project at design time:Īdd a content control from the Word Controls tab of the Toolbox.Īdd a content control to your document in the same manner you would add a native content control in Word.ĭrag a content control to your document from the Data Sources window. This topic describes the following tasks:Īdd content controls at run time in a document-level projectĪdd content controls at run time in a VSTO Add-in projectįor information about content controls, see Content controls. For more information, see Features available by Office application and project type. In Word VSTO Add-in projects, you can add content controls to any open document at run time.Īpplies to: The information in this topic applies to document-level projects and VSTO Add-in projects for Word. In document-level Word projects, you can add content controls to the document in your project at design time or at run time.










How to link text boxes word 2016