Well, I give up the Sendkeys statement. Thank you. But what instea

K

Kalivoda

How can I choose a proprietary Word menu item that was installed by the third
party? This is not the member of the Word collection Dialogs. And when I
record a macro while opening such menu item from the keyboard, the macro is
void, no keystrokes...

I don't know any solution in VBA. Surely, that's my fault. Thanks for hints.
 
J

Jean-Guy Marcil

Kalivoda was telling us:
Kalivoda nous racontait que :
How can I choose a proprietary Word menu item that was installed by
the third party? This is not the member of the Word collection
Dialogs. And when I record a macro while opening such menu item from
the keyboard, the macro is void, no keystrokes...

I don't know any solution in VBA. Surely, that's my fault. Thanks for
hints.

Something like this may help you:

'_______________________________________
Dim cmdBarMenu As CommandBar
Dim cmdCtrlThird As CommandBarControl

Set cmdBarMenu = Application.CommandBars("Menu Bar")
Set cmdCtrlThird = cmdBarMenu.Controls("Third Pary Menu Name")

cmdCtrlThird.CommandBar.Controls(Index number of the menu item to
execute).Execute
'_______________________________________

For example, to activate the conversion settings of the Adobe PDF menu:

'_______________________________________
Dim cmdBarMenu As CommandBar
Dim cmdCtrlThird As CommandBarControl

Set cmdBarMenu = Application.CommandBars("Menu Bar")
Set cmdCtrlThird = cmdBarMenu.Controls("Adobe PDF")

cmdCtrlThird.CommandBar.Controls(4).Execute
'_______________________________________

Or, instead of the Index number, you can use the name of the item:

'_______________________________________
Dim cmdBarMenu As CommandBar
Dim cmdCtrlThird As CommandBarControl

Set cmdBarMenu = Application.CommandBars("Menu Bar")
Set cmdCtrlThird = cmdBarMenu.Controls("Adobe PDF")

cmdCtrlThird.CommandBar.Controls("Change Conversion Settings").Execute
'_______________________________________


If you are dealing with a sub menu within the menu, change

cmdCtrlThird.CommandBar.Controls(4).Execute

to

cmdCtrlThird.CommandBar.Controls(4).CommandBar.Controls(2).Execute

--

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