![]() |
#5
|
|||
|
|||
![]()
Hi Guessed, apology for querying again, could you please confirm I have the correct code below. I have put together a little test doc to test how it works. I created a content control dropdown, named it "EmploymentType". I created three options for the dropdown "Full time", "Part time" and "Casual". I then created plain text content control paras titling a couple "Full time" "Part time" "casual". I then copied your code to "this document" in VB. I also saved the document as a docm. Have I renamed the code correctly Guessed. I appreciate your assistance, apology I am new to this.
Private Sub Document_ContentControlOnExit(ByVal myCC As ContentControl, Cancel As Boolean) Dim aCC As ContentControl, sET As String If myCC.Title = "Full Time" Then sET = myCC.Range.Text For Each aCC In ActiveDocument.ContentControls aCC.Range.Font.Hidden = myCC.Title <> sET 'hide if CC title doesn't match selected employment type Next aCC End If If myCC.Title = "Part Time" Then sET = myCC.Range.Text For Each aCC In ActiveDocument.ContentControls aCC.Range.Font.Hidden = myCC.Title <> sET 'hide if CC title doesn't match selected employment type Next aCC End If If myCC.Title = "Casual" Then sET = myCC.Range.Text For Each aCC In ActiveDocument.ContentControls aCC.Range.Font.Hidden = myCC.Title <> sET 'hide if CC title doesn't match selected employment type Next aCC End If End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Create Custom Form in Outlook 2016, for the Message setting 'Do not include original message' | jsvictor1989@gmail.com | Outlook | 0 | 01-30-2019 10:54 PM |
trouble with input box | gummybear | Excel Programming | 0 | 12-04-2018 06:39 AM |
Need Help on Input Video into PPT | agus | PowerPoint | 2 | 07-13-2015 02:25 AM |
![]() |
Gardy | Outlook | 3 | 05-23-2012 01:20 AM |
![]() |
ubns | Word | 2 | 04-13-2012 06:28 AM |