Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 08-24-2018, 04:49 PM
macropod's Avatar
macropod macropod is offline Using Content Control Checkboxes to open associated excel files Windows 7 64bit Using Content Control Checkboxes to open associated excel files Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

To work with multiple content control checkboxes, you might use code like:
Code:
Private Sub Document_ContentControlOnExit(ByVal CCtrl As ContentControl, Cancel As Boolean)
Dim StrNm As String
Select Case CCtrl.Title
  Case "Check1": StrNm = "C:\Temp\MyWorkbook1.xls"
  Case "Check2": StrNm = "C:\Temp\MyWorkbook2.xls"
  Case "Check3": StrNm = "C:\Temp\MyWorkbook3.xls"
  Case "Check4": StrNm = "C:\Temp\MyWorkbook4.xls"
  Case Else: Exit Sub
End Select
Dim xlApp As New Excel.Application
With xlApp
  .Visible = True
  .Workbooks.Open (StrNm)
  .Activate
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
checkbox, content control, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Content Control Checkboxes to open associated excel files Export Word Drop-Down Content Control to Excel Specific Sheet nolanthomas32 Word VBA 4 09-19-2017 06:25 AM
Using Content Control Checkboxes to open associated excel files Populate Content Control Dropdowns from Excel Deirdre Kelly Word VBA 23 09-07-2017 02:51 PM
Using Content Control Checkboxes to open associated excel files Content Control Checkboxes wlcdo2 Word VBA 3 01-05-2017 05:52 PM
Using Content Control Checkboxes to open associated excel files Deleting a table from a content control -- preserving the content control BrainSlugs83 Word Tables 8 11-14-2013 03:06 AM
Using Content Control Checkboxes to open associated excel files Assigning Values to content control checkboxes and calculating results creative cathy Word Tables 13 10-07-2012 08:52 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:34 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