Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-24-2023, 01:43 AM
Borcki Borcki is offline If ContentControl CheckBox 1 is Checked Uncheck CC CheckBox2 Windows 11 If ContentControl CheckBox 1 is Checked Uncheck CC CheckBox2 Office 2021
Novice
If ContentControl CheckBox 1 is Checked Uncheck CC CheckBox2
 
Join Date: Nov 2023
Posts: 2
Borcki is on a distinguished road
Default If ContentControl CheckBox 1 is Checked Uncheck CC CheckBox2

Hey all,

i am relatively new to microsoft word vba and am getting frustrated. I had already gotten my document to run with the VBA script but then I realized that there is no print preview when you want to print. At that time I had two ActiveX checkboxes (CheckBox1 and CheckBox2).


I noticed that the print preview under "Print" is deactivated when one of the checkboxes is checked. Why is this the case?
The code was actually only "If CheckBox1 is selected, checkbox2 should not be selected and the bookmark "Login" should be displayed".

Now I am changing the two checkboxes to "ContentControl Checkboxes". I have already managed to display table 1 (with the bookmark "Registration") when you have selected "Check1". Now I have to get it back so that table 2 ("Logout") is displayed for "Check2" and "Check1" is unchecked and table 1 becomes invisible again.

Do you have any ideas for me?

All the VBA experts are smiling now, but I am slowly getting desperate ^^.

Thank you all for the help.

Greetings.
Reply With Quote
  #2  
Old 11-24-2023, 04:50 PM
gmaxey gmaxey is offline If ContentControl CheckBox 1 is Checked Uncheck CC CheckBox2 Windows 10 If ContentControl CheckBox 1 is Checked Uncheck CC CheckBox2 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Is there some code that you would like for us to look at?
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #3  
Old 11-25-2023, 01:41 AM
Borcki Borcki is offline If ContentControl CheckBox 1 is Checked Uncheck CC CheckBox2 Windows 11 If ContentControl CheckBox 1 is Checked Uncheck CC CheckBox2 Office 2021
Novice
If ContentControl CheckBox 1 is Checked Uncheck CC CheckBox2
 
Join Date: Nov 2023
Posts: 2
Borcki is on a distinguished road
Default

Quote:
Originally Posted by gmaxey View Post
Is there some code that you would like for us to look at?
Good morning,

oh sorry ive forgot to put the code for the ActiveX CheckBoxes. The code was

Privat Sub CheckBox1_Click()
If CheckBox1.Value = True Then
ActiveDocument.Bookmarks("Login").Range.Font.Hidde n = False
End If
If CheckBox1.Value = True Then CheckBox2.Value = False
End If
End Sub

Privat Sub CheckBox2_Click()
If CheckBox2.Value = True Then
ActiveDocument.Bookmarks("Logout").Range.Font.Hidd en = False
End If
If CheckBox2.Value = True Then
CheckBox1.Value = False
End if
End Sub

So the code only should show a bookmark and uncheck the other checkbox. But if you select a checkbox and you fill out the bookmark(its a table) your print preview is gone. If you didnt check a checkbox the print preview is still visible.

Now i wanna try this with the contentcontrol checkboxes.

Or do you have an idea why the print preview got disabled?

Thank you for your help

Last edited by Borcki; 11-25-2023 at 03:13 PM.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Script to delete ContentControl Checkboxes by Tag if a specific Checkbox is checked jlyons Word VBA 2 04-07-2022 06:49 AM
If ContentControl CheckBox 1 is Checked Uncheck CC CheckBox2 Word Formula IF checkbox checked soakn Word 1 11-21-2020 12:57 PM
VBA in Word 2010 to show certain text only when a YES checkbox is checked kdsim Word VBA 0 05-16-2018 05:16 AM
If ContentControl CheckBox 1 is Checked Uncheck CC CheckBox2 Merged Checkbox Fields Always Checked pdxplorer Mail Merge 11 12-20-2017 12:37 PM
If ContentControl CheckBox 1 is Checked Uncheck CC CheckBox2 Uncheck Checkbox Code not working if document protected bandrist Word VBA 2 08-14-2013 09:02 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:34 AM.


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