View Single Post
 
Old 08-24-2018, 04:49 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit 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