![]() |
|
#1
|
||||
|
||||
![]()
You didn't need to change my code other than to change the sET to something else eg strET.
The dropdown Content Control needs the title EmploymentType As Graham says, hiding content is problematic if you are sending docs to other people without converting to PDF first. If you get it working as it is, I can explain how to permanently delete the hidden content.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#2
|
|||
|
|||
![]()
Hey Guessed, I have got it working although it is not correct. Everything goes into hidden text. I did change the sSET to what Graham suggested.
I propose if I can get this going to create a macro to delete all hidden text. Any suggestions as to why everything turns to hidden text? I have checked that the names are all consistent within the VB code and the content controls. Also which I find a bit strange, even though the content control text is in hidden text (I can tell because of the dotted line underneath the text) - I can see it on the screen even though I have selection in File/Options do not show hidden text (box unticked). Here is the current code placed in "this document" : Private Sub Document_ContentControlOnExit(ByVal myCC As ContentControl, Cancel As Boolean) Dim aCC As ContentControl, strSet As String If myCC.Title = "Full Time" Then strSet = myCC.Range.Text For Each aCC In ActiveDocument.ContentControls aCC.Range.Font.Hidden = aCC.Title <> strSet 'hide if CC title doesn't match selected employment type Next aCC End If If myCC.Title = "Part Time" Then strSet = myCC.Range.Text For Each aCC In ActiveDocument.ContentControls aCC.Range.Font.Hidden = aCC.Title <> strSet 'hide if CC title doesn't match selected employment type Next aCC End If If myCC.Title = "Casual" Then strSet = myCC.Range.Text For Each aCC In ActiveDocument.ContentControls aCC.Range.Font.Hidden = aCC.Title <> strSet 'hide if CC title doesn't match selected employment type Next aCC End If End Sub thank you for your assistance, sorry about keep coming back - I think the error is something very simple, but I'm unable to see it. |
![]() |
|
![]() |
||||
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 |