Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2005

Tip: Looking for answers? Try searching our database.

using CommandBars OnUpdate event

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Enrico Pallazo - 24 Apr 2005 12:42 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.