4/11/2023 0 Comments Microsoft word showhide![]() ![]() Sub XMLUpdate(oCC As ContentControl, Optional Content As String) The table contains five plain text content controls titled "Answer_1 through Answer_5" and five checkboxes content controls (configured to resemble radio buttons) titled "ShowHide_1 through ShowHide_5." The table is illustrated below: It consists of a table containing five questions. To demonstrate this method I have used Word 20010. The method illustrated below can be adapted to use a dropdown list (show/hide) control for use in Word 2007. Unfortunately the checkbox content control was not introduced until Word 2010. Downloading and using my Content Control Tools Template Add-In makes this method very easy to set up and employ.Ģ. This method leverages content controls introduced with Word 2007 and their ability to be bound (or mapped) to a data node in a document CustomXML Part.ġ. The methods demonstrated previously will work for users limited to Word 2003 and earlier. Borders(wdBorderRight).LineStyle = wdLineStyleNoneĮnd Sub Method 3 - Mapped Content Controls Borders(wdBorderLeft).LineStyle = wdLineStyleNone Borders(wdBorderBottom).LineStyle = wdLineStyleNone Borders(wdBorderRight).LineStyle = wdLineStyleSingle Borders(wdBorderLeft).LineStyle = wdLineStyleSingle Borders(wdBorderBottom).LineStyle = wdLineStyleSingle Method 2 – Expand/Collapse Defined RangeĪ table row can serve as an ideal defined range which can be expanded and collapsed to show or hide document data. ![]() See: Installing Macros for instructions on how to set up and use the macros provided in this Microsoft Word Help & Microsoft Word Tips page. 'Create/Redefine document variable value.ĪctiveDocument.Variables(strVarName).Value = strValue If strValue = "" Or strValue = strValue_2 Then StrValue = ActiveDocument.Variables(strVarName) 'What is the value of the named document variable if it exists? 'An error will occur if the document variable does not yet exist. 'Call procedure and pass bookmark name as argument. 'It is the current selection and it is bound by a bookmark. 'This is the procedure defined in the MACROBUTTON. The following illustrates sample text using this method showing the data collapsed and expanded.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |