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 - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Outlook add-in - adding to the Appointments Insert menu



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 9th 06, 01:58 PM posted to microsoft.public.outlook.program_forms
Scott Lyon
external usenet poster
 
Posts: 2
Default Outlook add-in - adding to the Appointments Insert menu

I have been tasked with updating one of our legacy add-ins for Outlook. And
by "legacy", I mean that it was written entirely in VB6, with no immediate
plans to rewrite/update to .NET.


Currently the add-in (among other things) adds a custom menu to the Insert
menu when drafting an e-mail message.


I have been tasked with adding the same custom menu to the Insert Menu when
drafting a Meeting Request or Appointment.



The code I have for initially setting up the Message Insert menu is as
follows:


Dim NewInsertMenu As CommandBarPopup
Dim NewRefPopUp As CommandBarPopup


Set NewInsertMenu = colCB.FindControl(id:="30005")

Set PMCRefPopUp = NewInsertMenu
NewRefPopUp.Caption = "NewInsertSubMenu"
NewRefPopUp.BeginGroup = True
NewRefPopUp.Tag = "NewInsertSubMenu"



Unfortunately, I'm at a loss to figure out how to add that same menu to the
Appointments Insert menu.


Any ideas/suggestions?


I was hoping it'd just be a different Control ID (to replace the 30005 in
the code above), but I'm simply not finding it online or otherwise.


Thanks!
Ads
  #2  
Old October 9th 06, 03:29 PM posted to microsoft.public.outlook.program_forms
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Outlook add-in - adding to the Appointments Insert menu

Are PMCRefPopUp and colCB declared somewhere?

Using this quickie VBA snippet I got the Insert menu from an open
appointment item that was ActiveInspector:

Dim NewInsertMenu As CommandBarPopup

Set NewInsertMenu = _
Application.ActiveInspector.CommandBars("Menu
Bar").FindControl(ID:="30005")

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Scott Lyon" wrote in message
...
I have been tasked with updating one of our legacy add-ins for Outlook. And
by "legacy", I mean that it was written entirely in VB6, with no immediate
plans to rewrite/update to .NET.


Currently the add-in (among other things) adds a custom menu to the Insert
menu when drafting an e-mail message.


I have been tasked with adding the same custom menu to the Insert Menu
when
drafting a Meeting Request or Appointment.



The code I have for initially setting up the Message Insert menu is as
follows:


Dim NewInsertMenu As CommandBarPopup
Dim NewRefPopUp As CommandBarPopup


Set NewInsertMenu = colCB.FindControl(id:="30005")

Set PMCRefPopUp = NewInsertMenu
NewRefPopUp.Caption = "NewInsertSubMenu"
NewRefPopUp.BeginGroup = True
NewRefPopUp.Tag = "NewInsertSubMenu"



Unfortunately, I'm at a loss to figure out how to add that same menu to
the
Appointments Insert menu.


Any ideas/suggestions?


I was hoping it'd just be a different Control ID (to replace the 30005 in
the code above), but I'm simply not finding it online or otherwise.


Thanks!


  #3  
Old October 9th 06, 04:23 PM posted to microsoft.public.outlook.program_forms
Scott Lyon
external usenet poster
 
Posts: 2
Default Outlook add-in - adding to the Appointments Insert menu

Sorry about that. That's what I get for trying to clip out code before
posting - mistakes and cutting too much.

Here's a better representation of the code:


Dim NewInsertMenu As CommandBarPopup
Dim NewRefPopUp As CommandBarPopup
Dim colCB As Office.CommandBars
Public WithEvents myItems As Inspectors


Private Sub myItems_NewInspector(ByVal Inspector As outlook.Inspector)

Set colCB = Inspector.CommandBars

Set NewInsertMenu = colCB.FindControl(id:="30005")

Set NewRefPopUp.Caption = NewInsertMenu
NewRefPopUp.Caption = "NewInsertSubMenu"
NewRefPopUp.BeginGroup = True
NewRefPopUp.Tag = "NewInsertSubMenu"

' the rest of the code for the sub-menu here

End Sub


The thing that's strange, is while this adds the new sub-menu to the Insert
menu when editing an E-mail message, it does not add a new sub-menu to the
Insert menu when editing an Appointment.



-Scott


"Ken Slovak - [MVP - Outlook]" wrote:

Are PMCRefPopUp and colCB declared somewhere?

Using this quickie VBA snippet I got the Insert menu from an open
appointment item that was ActiveInspector:

Dim NewInsertMenu As CommandBarPopup

Set NewInsertMenu = _
Application.ActiveInspector.CommandBars("Menu
Bar").FindControl(ID:="30005")

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Scott Lyon" wrote in message
...
I have been tasked with updating one of our legacy add-ins for Outlook. And
by "legacy", I mean that it was written entirely in VB6, with no immediate
plans to rewrite/update to .NET.


Currently the add-in (among other things) adds a custom menu to the Insert
menu when drafting an e-mail message.


I have been tasked with adding the same custom menu to the Insert Menu
when
drafting a Meeting Request or Appointment.



The code I have for initially setting up the Message Insert menu is as
follows:


Dim NewInsertMenu As CommandBarPopup
Dim NewRefPopUp As CommandBarPopup


Set NewInsertMenu = colCB.FindControl(id:="30005")

Set PMCRefPopUp = NewInsertMenu
NewRefPopUp.Caption = "NewInsertSubMenu"
NewRefPopUp.BeginGroup = True
NewRefPopUp.Tag = "NewInsertSubMenu"



Unfortunately, I'm at a loss to figure out how to add that same menu to
the
Appointments Insert menu.


Any ideas/suggestions?


I was hoping it'd just be a different Control ID (to replace the 30005 in
the code above), but I'm simply not finding it online or otherwise.


Thanks!



  #4  
Old October 9th 06, 09:29 PM posted to microsoft.public.outlook.program_forms
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Outlook add-in - adding to the Appointments Insert menu

Are you getting a handle to the Insert menu? It should work for any item
type except for notes (IPM.StickyNote), those are brain dead.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Scott Lyon" wrote in message
...
Sorry about that. That's what I get for trying to clip out code before
posting - mistakes and cutting too much.

Here's a better representation of the code:


Dim NewInsertMenu As CommandBarPopup
Dim NewRefPopUp As CommandBarPopup
Dim colCB As Office.CommandBars
Public WithEvents myItems As Inspectors


Private Sub myItems_NewInspector(ByVal Inspector As outlook.Inspector)

Set colCB = Inspector.CommandBars

Set NewInsertMenu = colCB.FindControl(id:="30005")

Set NewRefPopUp.Caption = NewInsertMenu
NewRefPopUp.Caption = "NewInsertSubMenu"
NewRefPopUp.BeginGroup = True
NewRefPopUp.Tag = "NewInsertSubMenu"

' the rest of the code for the sub-menu here

End Sub


The thing that's strange, is while this adds the new sub-menu to the
Insert
menu when editing an E-mail message, it does not add a new sub-menu to the
Insert menu when editing an Appointment.



-Scott


 




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
Novice: Adding a menu to current menu? Peter Add-ins for Outlook 4 October 2nd 06 03:34 PM
Scanner not in Insert menu tk Outlook - General Queries 2 July 27th 06 01:27 PM
Do not have "Insert Item" on Paperclip or Insert menu in e-mail Ioparto Outlook - General Queries 7 June 29th 06 08:52 PM
adding a context menu in Outlook donald Add-ins for Outlook 6 May 3rd 06 01:49 PM
Adding Outlook Express to my start menu MP Boettger Outlook - General Queries 1 February 22nd 06 05:45 PM


All times are GMT +1. The time now is 01:40 AM.


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