Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #9  
Old 09-14-2020, 05:33 AM
4Star1957 4Star1957 is offline Message box to input a value Windows 10 Message box to input a value Office 2016
Novice
Message box to input a value
 
Join Date: Sep 2020
Posts: 12
4Star1957 is on a distinguished road
Default

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



Similar Threads
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
Message box to input a value Message replys are shown at the bottom of the message, how can I get them to the top Gardy Outlook 3 05-23-2012 01:20 AM
Message box to input a value Input Box ubns Word 2 04-13-2012 06:28 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:00 PM.


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