![microsoft word 2007 remove content controls microsoft word 2007 remove content controls](https://www.sitesbay.com/word/images/delete-text-in-word.png)
To ease this workload, I have created simple template add-in that contains a macro procedure which will loop through each content control in your document, display the properties dialog, and provides a custom dialog for setting the placeholder text. When you create a new template or document using lots of content controls all of the mouse work involved in setting properties and custom placeholder text can become quite laborious. See: Installing Macros for instructions on how to set up and use the macros provided in this Microsoft Word Help & Microsoft Word Tips page. Note: For an interesting summary of content control placeholder text oddities, see: 5 Curiosities about Placeholders in Word Content Controls (for developers). If you are familiar with the Word object module you may notice from the code above that the ContentControl object has a property ".PlaceholderText." and that property itself is an object and not a string!! & "Click the ""empty"" or ""title"" tag of the" _ MsgBox "You must select a single ContentControl." & vbCr + vbCr _ SetPlaceHolderText, , InputBox("Type your new placeholder text below.", _ There is no method in the properties dialog to modify the placeholder text. For a work around, see my: Content Control Custom Checkboxes and Interactive Toggle Objects. The following illustrations show the default placeholder text for a plain text (left) and dropdown content control (right) and the corresponding properties dialog. Table 1 Note: The Check Box content control is new in Word 2010 and was not available in Word 2007. I had done this my using content control Rich text format. The first problem i have is below I have created a template document were users insert text in certain areas of the document. For reasons unknown to me, Microsoft left out the option in this dialog to modify the placeholder text. I am having a problem with content Control in office word. With the "Properties" command in the Controls group you can set the properties for the various control types. Like the picture content control, the checkbox does not use placeholder text. Note: Word 2010 added an eight "Checkbox" content control. Right-click on any of the content controls from the document body. Six of the seven control types includes a default placeholder text (the Picture content control does not use placeholder text). Here’s how: Press Ctrl+A to select the whole document. Using the "Controls" group on the Developer tab you can insert one of seven different content controls in your Word document. If you haven't used these yet then be sure to enable the Developer tab of your Word 2007 application and check them out. I think that content controls are, without a doubt, the best enhancement in Word 2007.
![microsoft word 2007 remove content controls microsoft word 2007 remove content controls](https://docs.microsoft.com/en-us/office/client-developer/word/media/dk2_wordcc_fig08.jpg)
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.The purpose of this Microsoft Word Tips & Microsoft Word Help page will show you how you can quickly modify content control properties including the placeholder text.
![microsoft word 2007 remove content controls microsoft word 2007 remove content controls](https://dradisframework.com/images/guides/word_reports/reports-16.png)
Bind a Content Control to a Node in the Data Store.If OldContentControl.Title = "MyTitle" Thenįor Each objPart In ActiveDocument.CustomXMLParts 'Also delete the part with a root element called 'tree' 'Always void changing the Word document surface during undo! Private Sub Document_ContentControlBeforeDelete( _īyVal OldContentControl As ContentControl, _ The second code sample removes the entire CustomXMLPart object when the content control is deleted. Set oContentControl = (wdContentControlText)ĪctiveDocument.CustomXMLParts(4).Load ("c:\mySampleCustomXMLFile.xml")
![microsoft word 2007 remove content controls microsoft word 2007 remove content controls](https://i.pinimg.com/736x/06/bc/56/06bc565fdadcaa9f4652c001ef9a08c2.jpg)
Sub AddContentControlAndCustomXMLPart()ĭim oContentControl As Word.ContentControl Now, suppose the content control is mapped to a node of the previous custom XML part. Suppose the content control is mapped to the following sample custom XML file. The first code sample creates a content control and sets an XML mapping on a content control.īuild a valid custom XML file, save it to your hard disk drive, and add a data store to the document that contains the information you want to map to. You can delete an entire custom XML part by calling the Delete method of the CustomXMLPart object that you want to remove.įor more information about content controls, see orking with Content Controls.ĬustomXMLPart (Microsoft Office system core object model)ĬustomXMLParts (Microsoft Office system core object model) You can also delete a single node by calling the Delete method of the CustomDataXMLNode object that you want to remove. For example, the following code deletes the content control with the title "MyTitle". You can delete a content control by calling the Delete method of the ContentControl object.