Find Control ID

V

vagabond

This is probably so simple...

I need to find some control IDs in Outlook to use in policy templates.

I follow MS's sample instructions, below, as follows:

Start Outlook

Go to Tools, Macro, VBE

Open the "immediate window"

Paste: ? commandbars ("menu bar").controls ("file").controls ("save as.").id

Press enter

Get:

---------------------------
Microsoft Visual Basic
---------------------------
Compile error:

Sub or Function not defined
---------------------------
OK Help
---------------------------

What am I doing wrong?

Thanks

John



MS Instructions:

You can use the Immediate window in VBA to look up the control ID for a single item on a menu if you know the name of the command bar it is on, the name of the control, and if necessary, the name of the sub control (if one exists). For example, the following command prints the control ID for the Save As command (File menu) to the Immediate window (directly below the command you enter). Start Microsoft Word, select Tools, select Macros, then select Visual Basic Editor. Enter the following command in the Immediate Window and press enter.

Example Code #1
? commandbars("menu bar").controls("file").controls("save as...").id
 
V

vagabond

Following the steps in the following link (in Word) allowed me to find the IDs


http://groups.google.com/groups?hl=...F-8&oe=UTF-8&q=vba+outlook+control+id&spell=1


This is probably so simple...

I need to find some control IDs in Outlook to use in policy templates.

I follow MS's sample instructions, below, as follows:

Start Outlook

Go to Tools, Macro, VBE

Open the "immediate window"

Paste: ? commandbars ("menu bar").controls ("file").controls ("save as.").id

Press enter

Get:

---------------------------
Microsoft Visual Basic
---------------------------
Compile error:

Sub or Function not defined
---------------------------
OK Help
---------------------------

What am I doing wrong?

Thanks

John



MS Instructions:

You can use the Immediate window in VBA to look up the control ID for a single item on a menu if you know the name of the command bar it is on, the name of the control, and if necessary, the name of the sub control (if one exists). For example, the following command prints the control ID for the Save As command (File menu) to the Immediate window (directly below the command you enter). Start Microsoft Word, select Tools, select Macros, then select Visual Basic Editor. Enter the following command in the Immediate Window and press enter.

Example Code #1
? commandbars("menu bar").controls("file").controls("save as...").id
 
T

Tom Winter

Outlook is a little different from other Office applications, in that the
Application object does NOT have a CommandBars property. In Outlook,
CommandBars are attached to individual Explorer and Inspector objects.

Try this out:

? activeexplorer.CommandBars("menu bar").controls("file").controls("save
as...").id

Note that we start with "activeexplorer".

If you need more help with this type of stuff in Outlook, it's probably
better to ask in one of the Outlook groups, like
microsoft.public.outlook.program_vba.

-Tom
 

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