How To Use CommandBars To Select Item From Menu

G

Gary

I have an application that is controlled only from a commandbar and I can not
access it via VBA code. I am use Access OLE to interface with a Visio
program and I am trying to control an Pen Ink object. I have posted this
question on Visio for over two weeks with no reponds. There not much
happening there on the Developer part.

I am able to use the CommandBar("Menu
Bar").Controls("Edit").Controls("Select All").accDoDefaultAction. This
command works. I see everything selected.

There is a separate Toolbar called "Ink" which I was also able to access
with the command:
CommandBar("Ink").Controls("3 Felt-Tip Pen").accDoDefaultAction. The 3 felt
tip pen was selected.

There is a "Ink Thickness" which is a drop down menu that has options like:
1 pt, 1-1/4 pt, 1-1/2 pt, 1-3/4 pt, 2 pt, etc.

I have tried various things to try to pass the selection, but failed.
I tried .Controls("2 pt").accDoDefaultAction and nothing happens.

I assume is is like select the line width??? I don't know how to do that
either.


Can someone please help me!! Any suggestions would be deeply
appreciated!!!!

Thank You,

Gary
 
V

Van T. Dinh

My guess is that "2 pt" is not a Control. It sounds only a value in the
list of available values of the Control "Ink Thickness".

If this is the case, I think you need to set the value of the ListIndex
Property on the CommandBarComboBox "Ink Thickness".

Check Office VBA Help on the ListIndex Property of the CommandBarComboBox.
 

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