control ids for visio 2007

  • Thread starter Robbie van der Walle
  • Start date
R

Robbie van der Walle

Hello,

I am trying to find the right control ids for visio 2007. I find already a
few control ids but not all of them and i don't know anything about visual
basic.
Important for example is trust center.
I need this control ids to lock down visio 2007 which is running on a
terminal server.

Any ideas ?

Robbie
 
N

Nikolay Belyh

Hello,

I am trying to find the right control ids for visio 2007. I find already a
few control ids but not all of them and i don't know anything about visual
basic. Important for example is trust center.
I need this control ids to lock down visio 2007 which is running on a
terminal server.

Any ideas ?

Hello, Robbie.

What are those "control ids" you are looking for? And what for do need
to "locking down" the Visio..?
Do you mean the native Windows IDs of Visio menus/buttons/editboxes,
etc? IMHO knowning these IDs is rather useless for blocking Visio UI.
Anyways, you can find those IDs using tools like "Spy++" from Visual
Studio.

Kind regards, Nikolay.
 
J

John Goldsmith

Hello Robbie,

The article you have gives you the code to retrieve the commandbar control
IDs, but it's a bit dull clicking the ok button for each one so I've adapted
the code to print you a list:

Sub EnumerateControls()
Dim icbc As Integer
Dim cbs As CommandBar
Dim cbcs As CommandBarControls
Set cbs = Application.CommandBars("Menu Bar")
For x = 1 To cbs.Controls.Count
Set cbcs = cbs.Controls(x).Controls
For icbc = 1 To cbcs.Count
Debug.Print cbs.Controls(x).Caption, _
cbcs(icbc).Caption, cbcs(icbc).ID
Next icbc
Next x
End Sub

I see that you say you're not a great VBA expert so here's a good chance to
have a go:

1) Create a new blank document in Visio.

2) Press alt+F11 to open the VBA editting window (VBE).

3) In the VBE click Insert / Module and paste the code above into the new
blank area on the right.

4) Press ctrl+G to display the "Immediate" window.

5) Press F5 to run the procedure and the control ID's should all be printed
to the Immediate window from where you can copy and paste into Word if that
makes it easier to read.

One point is that the above code (and in the KB article) only looks at the
first level menu items so, for example, you'll see Tools / Spelling, but not
Tools / Spelling / Spelling Options. If you need to disable these sub items
let me know which ones you're after and I can adapt the code.

Hope that helps.

Best regards

John

John Goldsmith
www.visualSignals.co.uk
 

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