Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-27-2019, 03:04 PM
chappeja chappeja is offline Reveal portion of document based on dropdown selection Windows 10 Reveal portion of document based on dropdown selection Office 2016
Novice
Reveal portion of document based on dropdown selection
 
Join Date: Mar 2019
Posts: 1
chappeja is on a distinguished road
Default Reveal portion of document based on dropdown selection


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.
Reply With Quote
  #2  
Old 03-27-2019, 08:36 PM
Guessed's Avatar
Guessed Guessed is offline Reveal portion of document based on dropdown selection Windows 10 Reveal portion of document based on dropdown selection Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,969
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
Reply With Quote
Reply

Tags
conditional formatting



Similar Threads
Thread Thread Starter Forum Replies Last Post
Reveal portion of document based on dropdown selection Renumber document at annex portion of document 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
Reveal portion of document based on dropdown selection Dropdown selection value 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

Other Forums: Access Forums

All times are GMT -7. The time now is 02:52 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft