Mattie Owens
asked on
Content Control Event Firing randomly
I got this script here, and I thought it was working but appears to run when other controls are clicked as well. Is there solution. I only want the macro to run if I select either Item 1 or Item 2.
Sub MainMacro()
Dim cc As ContentControl
Set cc = ActiveDocument.ContentCont rols(1)
Select Case cc.Range.Text
Case "Item 1"
Call Macro1
Case "Item 2"
Call Macro2
End Select
End Sub
Sub Macro1()
MsgBox "One"
End Sub
Sub Macro2()
MsgBox "Two"
End Sub
Sub MainMacro()
Dim cc As ContentControl
Set cc = ActiveDocument.ContentCont
Select Case cc.Range.Text
Case "Item 1"
Call Macro1
Case "Item 2"
Call Macro2
End Select
End Sub
Sub Macro1()
MsgBox "One"
End Sub
Sub Macro2()
MsgBox "Two"
End Sub
can you upload a sample document and indicate what you need to do within that document?
ASKER
Here is a sample. I cannot upload the original.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Learning so much. Thanks for your help again.