OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Corel User Forums > CorelDRAW > Macros/Add-ons

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 15-06-2010, 11:56
lnfagf
Guest
 
Posts: n/a
Default Command Bar events

I need help on how I can integrate the example code below that I got from CorelDraw X3 and X4 help menu topics. My goal is to detect an event when an item of a command bar or tool bar is clicked. When I try to run it I get all kinds of errors. There are few topics in the Help menu when the keyword Commandbarevents is used to search for topics. But it does not explain how to use the example below. Any help would be greatly appreciated.

Click Event Example
The following example illustrates how you can set up code for a Click event procedure using WithEvents and Set. Note that the object reference ce is used in place of the menu name Tools in the name of the Click event.

Private WithEvents ce As CommandBarEvents

Sub Test()
Dim c As CommandBarControl
Set c = Application.VBE.CommandBars("Tools").Controls(1)
Set ce = Application.VBE.Events.CommandBarEvents(c)
End Sub

Private Sub ce_Click(ByVal CommandBarControl As Object, Handled As Boolean, CancelDefault As Boolean)
' Put event-handling code here
End Sub

Thank you.

Luis
Reply With Quote
  #2  
Old 15-06-2010, 14:06
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,787
Blog Entries: 11
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Menu

Are you trying to capture a click on a menu item already there? Or you are adding a menu item?

-Shelby
Reply With Quote
  #3  
Old 15-06-2010, 17:08
lnfagf
Guest
 
Posts: n/a
Default

Trying to capture that is already there.

Thank you.

Luis
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ThisDocument Events mapcar Corel Photo-Paint VBA 1 16-08-2009 14:23
Just use events ! TheFez CorelDRAW/Corel DESIGNER VBA 0 06-06-2008 03:23
Get Global Events Macronix CorelDRAW/Corel DESIGNER VBA 2 20-03-2006 11:07
Are there Other Events in CorelDraw? Jon Lorber CorelDRAW/Corel DESIGNER VBA 2 10-08-2005 09:17
How to use events from CorelDRAW.Document in my code? me CorelDRAW/Corel DESIGNER VBA 2 30-10-2004 02:49


All times are GMT -5. The time now is 13:46.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com