![]() See: Install/Employ VBA Procedures (Macros)įor instructions to employ the VBA code provided above. ORng.Start = Selection.Tables(1).Range.End If MsgBox("Do you want to loop to the first control?", vbQuestion + vbYesNo, "Router") = vbYes Thenįor Each oCell In Selection.Tables(1).Range.Cells (1).Range.Selectĭo Until Selection.Cells(1). > 0 The focus does not advance to the next control. Using the tab key in one of these controls enters a physical tab in the control as expected. The following example shows three rich text content controls grouped (nested) in a restricted content rich text control container. Rich text controlsįirst let's look at problems associated with rich text controls. For example, if they clicked the little '+' symbol too many times, they should be able to remove the excess sections. As the title states, I want users to be able to remove a section within a RSCC after adding it. Unfortunately navigating between content controls in documents containing rich text or picture content controls is more problematic. Removing a Repeating Section Content Control. Note: If there are one or more content controls in the document after your assigned "Last" content control then the focus will be set automatically to the content control tagged "First" when you tab out of the "Last" control. True removes both the content control and its contents.False removes the control but leaves the contents of the content control in the active document. DR dr.nixon Created on SeptemRemove content controls in Word Old Word documents with fillable form fields can be 'flattened' using Ctrl-Shift-F9 to convert all fields to plain text. Then, right-click a visible content control. Name Required/Optional Data type Description DeleteContents: Optional: Boolean: Specifies whether to delete the contents of the content control. ![]() When C1 is deleted, the 'ContentControlBeforeDelete' event on the document is triggered, then that is where I wrote my code. Press Ctrl+A to select the entire document. I am trying to add a code that deletes dome content controls (C2,C3), then a certain contentcontrol(C1) is deleted. Then when you finish in the last content control simply click anywhere in the document and the to exit the content control and the focus will be returned to the content control tagged "First." I am developing a VSTO Add-In for Word 2007. How do I set a reference to a content control, so the text in the content control will be shown other places in the text in Word 2007. '"First" = tag property applied to the first control.ĪctiveDocument.SelectContentControlsByTag("First").Item(1).Range.Select The code for removing content controls and leaving the content is: Sub ScratchMacro () A basic Word macro coded by Greg Maxey. '"Last" = tag property applied to the last control. Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |