Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-02-2015, 08:12 AM
Loss1003 Loss1003 is offline Help with Drop Down Box - Expand or Collapase Windows Vista Help with Drop Down Box - Expand or Collapase Office 2013
Novice
Help with Drop Down Box - Expand or Collapase
 
Join Date: Apr 2015
Posts: 3
Loss1003 is on a distinguished road
Default Help with Drop Down Box - Expand or Collapase

The following code is not working as I'm trying to Expand or Collapse with Drop Down Box in Word 2010

Code:
Sub Dropdown4() If FormFields("Dropdown4").DropDown.Value = "Observed" Then ActiveDocument.Bookmarks("RiskTData").Range.Font.Hidden = False End If If FormFields("Dropdown4").DropDown.Value = "Not Applicable" Then ActiveDocument.Bookmarks("RiskTData").Range.Font.Hidden = True End If If FormFields("Dropdown4").DropDown.Value = "Not Observed" Then ActiveDocument.Bookmarks("RiskTData").Range.Font.Hidden = True End If End Sub
Please assist with any errors per the above code. Thank you.

Reply With Quote
  #2  
Old 04-03-2015, 02:38 AM
gmayor's Avatar
gmayor gmayor is offline Help with Drop Down Box - Expand or Collapase Windows 7 64bit Help with Drop Down Box - Expand or Collapase Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The dropdown values are numeric values which represent the positions of the texts in the list. So you would use

Code:
Sub Dropdown4()
    Select Case ActiveDocument.FormFields("Dropdown4").Dropdown.Value
        Case 1
            ActiveDocument.Bookmarks("RiskTData").Range.Font.Hidden = False
        Case 2, 3
            ActiveDocument.Bookmarks("RiskTData").Range.Font.Hidden = True
        Case Else
    End Select
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 04-03-2015, 04:55 AM
gmaxey gmaxey is offline Help with Drop Down Box - Expand or Collapase Windows 7 32bit Help with Drop Down Box - Expand or Collapase Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,598
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

There are alternative ways other than hiding text. See: http://gregmaxey.com/word_tip_pages/toggle_data_display.html

Ditto to Graham's advise on cross posting.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Drop Down Box - Expand or Collapase Using Check Boxes and how to expand them SPT Word 3 02-25-2015 05:04 AM
How not disable expand/collapse LVP Word 3 12-21-2014 12:12 PM
Help with Drop Down Box - Expand or Collapase Drop-Down Menu, show-hide, expand-collapse??? 300zxmuro Word 1 02-27-2011 03:02 PM
Help with Drop Down Box - Expand or Collapase How to expand one column into two columns? Jamal NUMAN Excel 1 01-12-2011 07:59 PM
Grouping - expand all ejohns Excel 0 07-17-2009 07:15 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:15 AM.


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