Microsoft Office Mac Content Control
In document-level Word projects, you can add content controls to the document in your project at design time or at run time. In Word VSTO Add-in projects, you can add content controls to any open document at run time.
Applies to: The information in this topic applies to document-level projects and VSTO Add-in projects for Word. For more information, see Features available by Office application and project type.
This topic describes the following tasks:
Microsoft 隐私 – 你的数据,由你控制以支持你的体验。 在此网站的其余部分中,你会找到指向详细信息和控件的链接,以便你可以做出明智的决定。. You'll use your Microsoft Account for everything you do with Office. If you use a Microsoft service like Outlook.com, OneDrive, Xbox Live, or Skype, you already have an account.
For information about content controls, see Content controls.
Add Content controls at design time
There are several ways to add content controls to the document in a document-level project at design time:
Add a content control from the Word Controls tab of the Toolbox.
Add a content control to your document in the same manner you would add a native content control in Word.
Drag a content control to your document from the Data Sources window. This is useful when you want to bind the control to data when the control is created. For more information, see How to: Populate documents with data from objects and How to: Populate documents with data from a database.
Note
Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. For more information, see Personalize the IDE.
To add a content control to a document by using the Toolbox
In the document that is hosted in the Visual Studio designer, put the cursor where you want to add the content control, or select the text that you want the content control to replace.
Open the Toolbox and click the Word Controls tab.
Add the control one of the following ways:
Double-click a content control in the Toolbox.
or
Click a content control in the Toolbox and then press the Enter key.
or
Drag a content control from the Toolbox to the document. The content control is added at the current selection in the document, not at the location of the mouse pointer.
Note
You cannot add a GroupContentControl by using the Toolbox. You can only add a GroupContentControl in Word, or at run time.
Note
Visual Studio does not provide a check box content control in the Toolbox. To add a check box content control to the document, you must create a ContentControl object programmatically. For more information, see Content controls.
To add a content control to a document in Word
In the document that is hosted in the Visual Studio designer, put the cursor where you want to add the content control, or select the text that you want the content control to replace.
On the Ribbon, click the Developer tab.
Note
If the Developer tab is not visible, you must first show it. For more information, see How to: Show the Developer tab on the Ribbon.
In the Controls group, click the icon for the content control that you want to add.
Add content controls at run time in a document-level project
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. Each method has three overloads that you can use to add a content control in the following ways:
Add a control at the current selection.
Add a control at a specified range.
Add a control that is based on a native content control in the document.
Dynamically created content controls are not persisted in the document when the document is closed. However, a native content control remains in the document. You can recreate a content control that is based on a native content control the next time the document is opened. For more information, see Add controls to Office documents at run time.
Note
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 Content controls.
To add a content control at the current selection
Use a ControlCollection method that has the name
Add
<control class> (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.The following code example uses the AddRichTextContentControl method to add a new RichTextContentControl to the beginning of the document. To run this code, add the code to the
ThisDocument
class in your project, and call theAddRichTextControlAtSelection
method from theThisDocument_Startup
event handler.
To add a content control at a specified range
Use a ControlCollection method that has the name
Add
<control class> (where control class is the name of the content control class that you want to add, such as AddRichTextContentControl), and that has a Range parameter.The following code example uses the AddRichTextContentControl method to add a new RichTextContentControl to the beginning of the document. To run this code, add the code to the
ThisDocument
class in your project, and call theAddRichTextControlAtRange
method from theThisDocument_Startup
event handler.
To add a content control that is based on a native content control
Use a ControlCollection method that has the name
Add
<control class> (where control class is the name of the content control class that you want to add, such as AddRichTextContentControl), and that has aMicrosoft.Office.Interop.Word.ContentControl
parameter.The following code example uses the AddRichTextContentControl method to create a new RichTextContentControl for every native rich text control that is in the document. To run this code, add the code to the
ThisDocument
class in your project, and call theCreateRichTextControlsFromNativeControls
method from theThisDocument_Startup
event handler.
Add content controls at run time in a VSTO Add-in project
You can add content controls programmatically to any open document at run time by using a VSTO Add-in. To do this, generate a Document host item that is based on an open document, and then use methods of the Controls property of this host item. Each method has three overloads that you can use to add a content control in the following ways:
Add a control at the current selection.
Add a control at a specified range.
Add a control that is based on a native content control in the document.
Dynamically created content controls are not persisted in the document when the document is closed. However, a native content control remains in the document. You can recreate a content control that is based on a native content control the next time the document is opened. For more information, see Persist dynamic controls in Office documents.
For more information about generating host items in VSTO Add-in projects, see Extend Word documents and Excel workbooks in VSTO Add-ins at run time.
Note

To add a check box content control to a document, you must create a ContentControl object. For more information, see Content controls.
To add a content control at the current selection
Use a ControlCollection method that has the name
Add
<control class> (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.The following code example uses the AddRichTextContentControl method to add a new RichTextContentControl to the beginning of the active document. To run this code, add the code to the
ThisAddIn
class in your project, and call theAddRichTextControlAtSelection
method from theThisAddIn_Startup
event handler.
To add a content control at a specified range
Use a ControlCollection method that has the name
Add
<control class> (where control class is the name of the content control class that you want to add, such as AddRichTextContentControl), and that has a Range parameter.The following code example uses the AddRichTextContentControl method to add a new RichTextContentControl to the beginning of the active document. To run this code, add the code to the
ThisAddIn
class in your project, and call theAddRichTextControlAtRange
method from theThisAddIn_Startup
event handler.
To add a content control that is based on a native content control
Use a ControlCollection method that has the name
Add
<control class> (where control class is the name of the content control class that you want to add, such as AddRichTextContentControl), and that has aMicrosoft.Office.Interop.Word.ContentControl
parameter.The following code example uses the AddRichTextContentControl method to create a new RichTextContentControl for every native rich text control that is in a document, after the document is opened. To run this code, add the code to the
ThisAddIn
class in your project.For C#, you must also attach the
Application_DocumentOpen
event handler to the DocumentOpen event.
See also
These topics discuss how to:
Insert ad hoc text.
Tag content with content controls.
Add a custom button.
Inserting Ad Hoc Text
You can insert text between clause and section contentcontrols. To do this:
Click the tab on the ContentControl (clause) after the point in which you want to insert the text.
Click the scroll-up arrow.
If you want to insert text and there are no blanklines in between content controls, then you need to position yourcursor at the beginning, or end, of the content control and use arrowkey to move outside of the control.
Tagging Content with Content Controls
To tag content using content controls within a newMicrosoft Word document:
Highlight the clause text.
Select the Developer tab andclick on the Rich Text content control 'Aa' icon.
The highlighted text is wrapped in a box:
Image: Rich Text Content
This exampleillustrates the fields and controls on the Rich Text Content. Youcan find definitions for the fields and controls later on this page.
From the Developer tab, clickon the Properties option.
In the Tag field, enter new_clause.
Image: Content Control Properties window from the Developertab
Thisexample illustrates the fields and controls on the Content ControlProperties window from the Developer tab. You can find definitionsfor the fields and controls later on this page.
Continue step three and fourfor id, title,full_text, and by_reference.
If you only add a content control using the new_clause tag to a clause with no othercontent controls within the new_clause tag, then all text in the content control will be imported as fulltext.
If you have many clauses to import, you can streamlinethis process by adding custom buttons to the Quick Access Tool barin Word. This enables you to highlight various sections of a clauseand use these buttons to tag clauses with a single click for eachproperty: new_clause, id, title, full_text, and by_reference.
See Understanding the Object Import and Creation Process.
Adding a Custom Button
Using custom buttons enables you to streamline thetagging process for large documents. Adding buttons that insert arich text Content Control and set properties for the selected controlcan be performed on a two-step process:
Record the macro.
Add the recorded macro to theQuick Access Toolbar
Note: This information is suggested based on MicrosoftWord functionality and is not controlled by Oracle functionality.
Microsoft Office
Recording the Macro
To record the macro:
Cant find my microsoft word on my mac computer. Open Word and click on the Developertab.
In the Code group box, clickthe Record Macro button.
In the Record Macro window, enter new_clause in the Macro name field.
In the Store macro in field, select All Documents (Normal.dotm).
Image: Record Macro window
This exampleillustrates the fields and controls on the Record Macro window. Youcan find definitions for the fields and controls later on this page.
Click the OK button to beginrecording.
In the Controls group box, clickthe Rich Text (Aa) icon
In the Controls group box, clickthe Properties icon.
In the Content Control Propertieswindow, enter new_clause inthe Tag field.
Image: Content Control Properties window when recordinga macro
Thisexample illustrates the fields and controls on the Content ControlProperties window when recording a macro. You can find definitionsfor the fields and controls later on this page.
On the Content Control Propertieswindow, click the OK button.
In the Code group box, clickon the Stop Recording button.
Adding a Recorded Macro to the Quick AccessToolbar
The Quick Access Toolbar is located in the upper-leftportion of the Word window. It is a customizable toolbar where youcan place buttons for frequently used commands or macros.
To add a recorded macro to the Quick Access Toolbar:
Right-click on the Quick Accesstoolbar and select Customize Quick Access Toolbar.
Image: Quick Access Toolbar - right click
Thisexample illustrates the fields and controls on the Quick Access Toolbar- right click. You can find definitions for the fields and controlslater on this page.
This opens the Word Options window.
From the left pane, click the Choose commands from drop-down and select Macros.
Image: Word Options window - Macros
Thisexample illustrates the fields and controls on the Word Options window- Macros. You can find definitions for the fields and controls lateron this page.
From the left pane, click onetime on the macro name Normal.NewMacros.new_clause.
In the center of the two panes,click the Add >> button.
This moves the Normal.NewMacros.new_clause to the right pane.
Image: Word Options window - Add
Compare and pull request. Key difference: Mac OS X can only be run on a computer designed and sold by Apple; however, Windows can be bought and run on any computer, even Apple computers. Mac OS X and Microsoft Windows are two most popular operating systems for computers today. OS X is exclusively for Apple computers, which are commonly called Macs, while Windows is basically for any personal computer from any company. Difference Between Apple Mac OS X and Microsoft Windows. Harlon Moss Updated: June 25, 2019 4 Min Read. Main Difference. Apple Macos X and Microsoft Windows will be the working bundles. Apple Macos X Comes from FreeBSD called”Osx” created from the Apple. Apple Mac osx is currently customized from the Apple because of its personal line of.
Thisexample illustrates the fields and controls on the Word Options window- Add. You can find definitions for the fields and controls lateron this page.
Below the right pane, click the Modify button to apply an icon of yourchoice to this button.
Image: Modify Button window
This exampleillustrates the fields and controls on the Modify Button window. Youcan find definitions for the fields and controls later on this page.
From the Modify Button window,select a button and enter new_clause in the Display name field.
This enables this name to appear when you hoveryour mouse pointer over the icon from the Quick Access Toolbar.
Click the OK button.
The macro button for the new_clause macro is nowlocated in the Quick Access Toolbar. When you want to tag a sectionof a clause as a new_clause, highlight the text and click the button.The clause section will be tagged with the content control tags showinga new_clause.
Repeat these steps to create macro buttons for theseremaining content control tags: id, title, full_text, and by_reference.
Example of a Clause Tagged with Multiple ContentControls
This is an example of a clause that is tagged withmultiple content controls for clause title and full text. This ishow your clauses should appear in your Word document:
Microsoft Office Mac Content Control Date
Image: Tagged Clause
Thisexample illustrates the fields and controls on the Tagged Clause.You can find definitions for the fields and controls later on thispage.
Microsoft Office Mac Content Controller
Note: To view the tab on the left side, you must clickon the text. To view the tags, such as new_clause and title, you mustbe in Design Mode (Developer, Design Mode).