![]() |
|
#1
|
|||
|
|||
![]()
Hey, I'm trying to show or keep hidden a portion of my document based on a dropdown selection, but I have no idea where to even start. The title of the dropdown is "Service Type" with 5 selections. I want a specific portion of the same document to be revealed if "Safety" is selected from the dropdown, and if any other value is selected, that section of the document will remain hidden. Any help would be appreciated.
|
#2
|
||||
|
||||
![]()
The Service Type should be a Dropdown Content Control with a title of "Service Type"
Your document should be saved as a docm so it can contain a macro Bookmark the text that needs to hide/show with the name "Safety" In the ThisDocument module in the document, copy in this macro Code:
Private Sub Document_ContentControlOnExit(ByVal aCC As ContentControl, Cancel As Boolean) If aCC.Title = "Service Type" Then ActiveDocument.Bookmarks("Safety").Range.Font.Hidden = Not aCC.Range.Text = "Safety" End If End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
![]() |
Tags |
conditional formatting |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
jeffreybrown | Word | 3 | 02-14-2019 05:53 AM |
Selection of a dropdown creates another dropdown wih the list | krishnamurthy.ka2810 | Word VBA | 1 | 04-26-2018 11:44 PM |
Save as PDF only saves portion of document | pandro | Word | 0 | 10-08-2014 06:54 AM |
![]() |
coconutt | Word VBA | 5 | 09-13-2012 05:23 PM |
Macro to populate a text form field based on dropdown selection | koloa | Word | 0 | 10-20-2011 11:52 AM |