-
WSmandelbrot
AskWoody LoungerHi, Jefferson. Do you something like this attatchment? In this document, there are some sample macros. SetHook( ) tries to set an event hook for the font color button. However, when I assign that control to a button variable, the VB interpreter says that “type mismatch”. In fact, it is not a “msoControlButton” but a “msoControlSplitDropdown”. Although a variable of msoCommandBarControl type can handl it, but such a variable does not any event.
Actually, I found 3 approaches to intercept the commands for Word. The first 1 is to set the event listeners for buttons. The second one is to change the onAction attribute. The last one is to create overriding macros with the same command name. None of them is a complete solution, but I am considering whether a combination would meet my requirement.
-
WSmandelbrot
AskWoody LoungerThis approach works perfect for buttons. It even allows me to cancel the user actions. But for combo boxes, it only notifies me. What’s worse is that for some complex controls (such as undo, font color, fill color), it does not work any more. When the attatched combo box changes, I get the notification. But if the main button (e.g. undo button) is clicked, there is no way to intercept it.
Is there anyting complemetary to this approach?
Regards
-
WSmandelbrot
AskWoody LoungerThis approach works perfect for buttons. It even allows me to cancel the user actions. But for combo boxes, it only notifies me. What’s worse is that for some complex controls (such as undo, font color, fill color), it does not work any more. When the attatched combo box changes, I get the notification. But if the main button (e.g. undo button) is clicked, there is no way to intercept it.
Is there anyting complemetary to this approach?
Regards
-
WSmandelbrot
AskWoody LoungerAnother problem of using caption is that it changes during the running process. For example, the caption of the undo button is “Can’t Undo”. And then it becomes “Undo sth…”. Are there any other ways not so troublesome?
Regards
-
WSmandelbrot
AskWoody LoungerAnother problem of using caption is that it changes during the running process. For example, the caption of the undo button is “Can’t Undo”. And then it becomes “Undo sth…”. Are there any other ways not so troublesome?
Regards
-
WSmandelbrot
AskWoody LoungerHi, Andrew. I cannot make it work with Howard’s code either. If you find the reason, can you put it here please?
Thanks
-
WSmandelbrot
AskWoody LoungerHi, Andrew. I cannot make it work with Howard’s code either. If you find the reason, can you put it here please?
Thanks
-
WSmandelbrot
AskWoody LoungerI think it works better to monitor the button events than my initial idea to override the buttons. It also works for other Office application. I will try this one.
Thanks, Jefferson.
-
WSmandelbrot
AskWoody LoungerI think it works better to monitor the button events than my initial idea to override the buttons. It also works for other Office application. I will try this one.
Thanks, Jefferson.
-
WSmandelbrot
AskWoody LoungerIn my Word 2K the command DrawGroup showed up when I executed ListCommands but it does not in my Word XP. However, when I created the macro DrawGroup in Word XP, it automatically put the statement WordBasic.DrawGroup in the sub, which acknowledges that it is an internal command in Word (I think). But neither version works to intercept.
What a strange application! I don’t know what they are thinking about when they designed it.
-
WSmandelbrot
AskWoody LoungerIn my Word 2K the command DrawGroup showed up when I executed ListCommands but it does not in my Word XP. However, when I created the macro DrawGroup in Word XP, it automatically put the statement WordBasic.DrawGroup in the sub, which acknowledges that it is an internal command in Word (I think). But neither version works to intercept.
What a strange application! I don’t know what they are thinking about when they designed it.
-
WSmandelbrot
AskWoody LoungerI tried in both 2K and XP but failed in both. I do not have a Word 2003 at hand so cannot test. Is it a bug only solved in 2003? But it seems unlikely.
I put the Sub in the “All active templates and documents”. The code is rather simple and I cannot see any error in it.
Sub DrawGroup()
MsgBox (“Group”)
WordBasic.DrawGroupEnd Sub
-
WSmandelbrot
AskWoody LoungerI tried in both 2K and XP but failed in both. I do not have a Word 2003 at hand so cannot test. Is it a bug only solved in 2003? But it seems unlikely.
I put the Sub in the “All active templates and documents”. The code is rather simple and I cannot see any error in it.
Sub DrawGroup()
MsgBox (“Group”)
WordBasic.DrawGroupEnd Sub
-
WSmandelbrot
AskWoody LoungerThanks anyway. At least I can intercept some of them based on your previous posts.
-
WSmandelbrot
AskWoody LoungerThanks anyway. At least I can intercept some of them based on your previous posts.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Excessive security alerts
by
WSSebastian42
1 hour, 42 minutes ago -
* CrystalDiskMark may shorten SSD/USB Memory life
by
Alex5723
2 hours, 30 minutes ago -
Ben’s excellent adventure with Linux
by
Ben Myers
2 hours, 50 minutes ago -
Seconds are back in Windows 10!
by
Susan Bradley
3 hours, 42 minutes ago -
WebBrowserPassView — Take inventory of your stored passwords
by
Deanna McElveen
3 hours, 43 minutes ago -
OS news from WWDC 2025
by
Will Fastie
3 hours, 44 minutes ago -
Need help with graphics…
by
WSBatBytes
2 hours, 25 minutes ago -
AMD : Out of Bounds (OOB) read vulnerability in TPM 2.0 CVE-2025-2884
by
Alex5723
17 hours, 58 minutes ago -
Totally remove or disable BitLocker
by
CWBillow
16 hours, 51 minutes ago -
Windows 10 gets 6 years of ESU?
by
n0ads
4 hours, 47 minutes ago -
Apple, Google stores still offer China-based VPNs, report says
by
Nibbled To Death By Ducks
1 day, 4 hours ago -
Search Forums only bring up my posts?
by
Deo
1 day, 4 hours ago -
Windows Spotlight broken on Enterprise and Pro for Workstations?
by
steeviebops
1 day, 16 hours ago -
Denmark wants to dump Microsoft for Linux + LibreOffice
by
Alex5723
1 day, 9 hours ago -
How to get Microsoft Defender to honor Group Policy Setting
by
Ralph
1 day, 17 hours ago -
Apple : Paragon’s iOS Mercenary Spyware Finds Journalists Target
by
Alex5723
2 days, 3 hours ago -
Music : The Rose Room – It’s Been A Long, Long Time album
by
Alex5723
2 days, 4 hours ago -
Disengage Bitlocker
by
CWBillow
1 day, 18 hours ago -
Mac Mini M2 Service Program for No Power Issue
by
Alex5723
2 days, 6 hours ago -
New Win 11 Pro Geekom Setup questions
by
Deo
1 day, 4 hours ago -
Windows 11 Insider Preview build 26200.5651 released to DEV
by
joep517
2 days, 13 hours ago -
Windows 11 Insider Preview build 26120.4441 (24H2) released to BETA
by
joep517
2 days, 13 hours ago -
iOS 26,, MacOS 26 : Create your own AI chatbot
by
Alex5723
2 days, 17 hours ago -
New PC transfer program recommendations?
by
DaveBoston
22 hours, 24 minutes ago -
Windows 11 Insider Preview Build 22631.5545 (23H2) released to Release Preview
by
joep517
2 days, 21 hours ago -
Windows 10 Build 19045.6029 (22H2) to Release Preview Channel
by
joep517
2 days, 21 hours ago -
Best tools for upgrading a Windows 10 to an 11
by
Susan Bradley
2 days, 9 hours ago -
The end of Windows 10 is approaching, consider Linux and LibreOffice
by
Alex5723
1 day, 13 hours ago -
Extended Windows Built-in Disk Cleanup Utility
by
bbearren
1 day, 22 hours ago -
Win 11 24H2 June 2025 Update breaks WIFI
by
dportenlanger
3 days, 16 hours ago
Recent blog posts
- Ben’s excellent adventure with Linux
- Seconds are back in Windows 10!
- WebBrowserPassView — Take inventory of your stored passwords
- OS news from WWDC 2025
- Best tools for upgrading a Windows 10 to an 11
- Master patch listing for June 10, 2025
- 24H2 may not be offered June updates
- June 2025 updates are out
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.