Any idea how to determine which CommandBar or
CommandBarButton/Control/etc. fired the OnUpdate event?
Also, I am having a bit of trouble getting the event to fire. I tried
this in a Class (I didn't forget to instantiate the event) and
ThisWorkbook (can't use WithEvents in a Module) but can't get it to
fire.
I had it working in the office (I am now at my home office), but I
can't remember how I got there...
... from ThisWorkbook ...
Public WithEvents CBars As CommandBars
Public CBar As CommandBar
Private Sub CBars_OnUpdate()
Set CBar = CBars(Me.CommandBars.ActiveMenuBar)
MsgBox CBar.Name & "<_>" & CBar.Index, vbOKOnly, "Class1"
End Sub
Jonathan West - 24 Apr 2005 15:10 GMT
Which version of Word are you using?
I have found that the OnUpdate event works as documented in Word 2000, but
that the event doesn't fire in Word 2003.

Signature
Regards
Jonathan
> Any idea how to determine which CommandBar or
> CommandBarButton/Control/etc. fired the OnUpdate event?
[quoted text clipped - 14 lines]
> MsgBox CBar.Name & "<_>" & CBar.Index, vbOKOnly, "Class1"
> End Sub
Enrico Pallazo - 26 Apr 2005 10:28 GMT
Actually, Excel XP (2002)
Enrico Pallazo - 26 Apr 2005 10:29 GMT
ISorry - I just realized this is the Word VBA group - I will move my
post elsewhere.