Disable Menu Command in Outlook 2002

N

niclas

Hi, I would like to configurate Outlook 2002 with Control ID and Group policies. I've seen an example how to get hold of the ID in XP Resource kit. ( http://www.microsoft.com/office/ork/xp/two/admB05.htm) BUT this code does not seem to work when I run it in Outlook 2002, the code does work in Excel, Word and Powerpoint. The code I run, is to be found underneath my name.

Any ideas would be appreciated.

Best regards.
Niclas L
------------------------------------------------
Sub EnumerateControls()
Dim icbc As Integer
Dim cbcs As CommandBarControls

Set cbcs = Application.CommandBars("Menu bar").Controls("File").Controls
For icbc = 1 To cbcs.Count
MsgBox cbcs(icbc).Caption & " = " & cbcs(icbc).ID
Next icbc
End Sub
-----------------------------------------------
 
S

Sue Mosher [MVP]

Outlook is different from other Office applications in that its CommandBars collection is a child object not of the Application object, but of Explorer and Inspector objects. You'd need to revise your code to enumerate menus for each of those objects and keep in mind that some menus are sensitive to the folder or type of item context. For a shortcut, get Outlook Spy from http://www.dimastr.com, which lets you read all the command bar IDs directly.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
K

Ken Slovak - [MVP - Outlook]

Unlike the other Office apps Outlook's command bars are accessed for
individual items (Inspector.CommandBars) and for folder views
(Explorer.CommandBars).

To show the various items available for the current window you would
use Application.ActiveExplorer.CommandBars. Be prepared for a couple
of Action menus and so on that are context sensitive, they appear when
the relevant type of folder is being displayed.




niclas said:
Hi, I would like to configurate Outlook 2002 with Control ID and
Group policies. I've seen an example how to get hold of the ID in XP
Resource kit. ( http://www.microsoft.com/office/ork/xp/two/admB05.htm)
BUT this code does not seem to work when I run it in Outlook 2002, the
code does work in Excel, Word and Powerpoint. The code I run, is to be
found underneath my name.
 

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