A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Getting a control ID from Item in SUB menu



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 26th 07, 04:58 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 1
Default Getting a control ID from Item in SUB menu

Hi,

I'm looking to disable some menu items in Outlook via GPO. This can be
achieved by giving the Control ID of the menu item.

I've found the VBA code that enables you to retrieve these ID's but
they only work for top level items on menus.

Sub EnumerateControls()
Dim icbc As Integer
Dim cbcs As CommandBarControls
Set cbcs = Application.ActiveExplorer.CommandBars("Menu
Bar").Controls("Tools").Controls
For icbc = 1 To cbcs.Count
MsgBox cbcs(icbc).Caption & " = " & cbcs(icbc).ID
Next icbc
End Sub

However, this does not recursively check sub menus.

Basically we need to disable Client-Side Rules under the ToolsRules
Wizard menu but I can't get the ID for the items in this sub menu.

Can anyone shed any light on this? Perhaps suggesting how I can
recursively check sub menus.. ?

Thanks

Neil.

  #2  
Old June 26th 07, 05:36 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Getting a control ID from Item in SUB menu

Try the code sample at http://www.outlookcode.com/codedetail.aspx?id=1507

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


wrote in message ups.com...
Hi,

I'm looking to disable some menu items in Outlook via GPO. This can be
achieved by giving the Control ID of the menu item.

I've found the VBA code that enables you to retrieve these ID's but
they only work for top level items on menus.

Sub EnumerateControls()
Dim icbc As Integer
Dim cbcs As CommandBarControls
Set cbcs = Application.ActiveExplorer.CommandBars("Menu
Bar").Controls("Tools").Controls
For icbc = 1 To cbcs.Count
MsgBox cbcs(icbc).Caption & " = " & cbcs(icbc).ID
Next icbc
End Sub

However, this does not recursively check sub menus.

Basically we need to disable Client-Side Rules under the ToolsRules
Wizard menu but I can't get the ID for the items in this sub menu.

Can anyone shed any light on this? Perhaps suggesting how I can
recursively check sub menus.. ?

Thanks

Neil.

  #3  
Old June 27th 07, 12:39 AM posted to microsoft.public.outlook.program_vba
McSlemon
external usenet poster
 
Posts: 1
Default Getting a control ID from Item in SUB menu

Thanks.. that did what I wanted it to do.. much appreciated.

Sadly, Client Side Rules comes up with 0 for an ID which indicates to
me that it can't be disabled.

Does anyone disagree with me? If so, how do I do it!!

Thanks.


  #4  
Old June 27th 07, 02:21 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Getting a control ID from Item in SUB menu

Sorry, but I don't know of any "Client Side Rules" command.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"McSlemon" wrote in message ups.com...
Thanks.. that did what I wanted it to do.. much appreciated.

Sadly, Client Side Rules comes up with 0 for an ID which indicates to
me that it can't be disabled.

Does anyone disagree with me? If so, how do I do it!!

Thanks.


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add a menu item to AppointmentItem's right-click menu? OctopusThu Add-ins for Outlook 6 January 25th 07 06:43 PM
Create Menu Item Chrischik Outlook and VBA 2 July 17th 06 08:13 PM
Menu item bug in Outlook 2003 QuasiCodo Outlook - Installation 1 June 13th 06 03:29 PM
missing menu item DavidW Outlook - Installation 6 May 7th 06 10:30 PM
Finding the control ID for the menu button that you want to disabl Tim Bolton Outlook and VBA 1 January 13th 06 06:35 AM


All times are GMT +1. The time now is 03:39 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright 2004-2025 Outlook Banter.
The comments are property of their posters.