Adding a new menu command in VB6, not VBA

I

Ianr

I launch word using the word object. I have successfully added menu
items from my vb6 app but I can't get it to handle the event when the
menu item is clicked on.

Set oNewMenu = CBarMenu.Controls.Add(msoControlButton, , SaveAsPosition
+ 1)

With oNewMenu
..Caption = "Do Something"
..OnAction = "MakeSmaller"
End With

Is it possible to handle the OnAction event in my VB6 application?? I
tried to create a function called "MakeSmaller" but it was nevercalled.
It just keeps saying the macro isn't found.
 
J

Jean-Guy Marcil

Ianr was telling us:
Ianr nous racontait que :
I launch word using the word object. I have successfully added menu
items from my vb6 app but I can't get it to handle the event when the
menu item is clicked on.

Set oNewMenu = CBarMenu.Controls.Add(msoControlButton, ,
SaveAsPosition + 1)

With oNewMenu
.Caption = "Do Something"
.OnAction = "MakeSmaller"
End With

Is it possible to handle the OnAction event in my VB6 application?? I
tried to create a function called "MakeSmaller" but it was
nevercalled. It just keeps saying the macro isn't found.


Have you tried to use the full macro path:
.OnAction = "ProjectName.ModuleName.MakeSmaller"
???
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top