![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi
i need to addd an item to the existinfg Context Menu (right click on outloook mail) the item should be "Status" and its sub-items are "Approve" & "Reject" Upon selecting "Approve", i should be able to update a field in my databse to 1 (and 0 for "Reject") any help....? i'm using Outlook 2007, VS 2005. Thanks & Regards, Muppidi. |
Ads |
#2
|
|||
|
|||
![]()
At least in this copy of your 5 messages posted here with the same question
you finally provided the needed information on your Outlook version. One post would have been enough. Using Outlook 2007 you can use the Application.ItemContextMenuDisplay() event to add your custom menu entry. Open the Outlook 2007 VBA project and in the Object Browser select that event and click F1 for more information on how to use that event. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Muppidi" wrote in message ... Hi i need to addd an item to the existinfg Context Menu (right click on outloook mail) the item should be "Status" and its sub-items are "Approve" & "Reject" Upon selecting "Approve", i should be able to update a field in my databse to 1 (and 0 for "Reject") any help....? i'm using Outlook 2007, VS 2005. Thanks & Regards, Muppidi. |
#3
|
|||
|
|||
![]()
Sorry Ken.
I got connection failure error when i was trying to post this. i've made 5 attempts and the final one worked out. but after that i saw 5 queries were posted. did not find any link to delete the extra queries. Coming to the point. i'm getting VBA sample code thru google. can u suggest a link or some sample code to use ItemContextMenuDisplay thru C# or VB.Net. Thanks & Regards, Muppidi. "Ken Slovak - [MVP - Outlook]" wrote: At least in this copy of your 5 messages posted here with the same question you finally provided the needed information on your Outlook version. One post would have been enough. Using Outlook 2007 you can use the Application.ItemContextMenuDisplay() event to add your custom menu entry. Open the Outlook 2007 VBA project and in the Object Browser select that event and click F1 for more information on how to use that event. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Muppidi" wrote in message ... Hi i need to addd an item to the existinfg Context Menu (right click on outloook mail) the item should be "Status" and its sub-items are "Approve" & "Reject" Upon selecting "Approve", i should be able to update a field in my databse to 1 (and 0 for "Reject") any help....? i'm using Outlook 2007, VS 2005. Thanks & Regards, Muppidi. |
#4
|
|||
|
|||
![]()
I don't know any links to managed code for that event handler, but it's
trivial to translate VBA code to VB.NET code. You can also look at the sample addins from MS on the Office developer site, those are in both VB.NET and C# and if I recall correctly the sample one for the rules addin and maybe the travel agency one have context menu code. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Muppidi" wrote in message ... Sorry Ken. I got connection failure error when i was trying to post this. i've made 5 attempts and the final one worked out. but after that i saw 5 queries were posted. did not find any link to delete the extra queries. Coming to the point. i'm getting VBA sample code thru google. can u suggest a link or some sample code to use ItemContextMenuDisplay thru C# or VB.Net. Thanks & Regards, Muppidi. |
#5
|
|||
|
|||
![]()
HI
i was able to debug without any errors now. but this is just opening the outlook and going out of debug mode. thats it. its not hitting the break points. i'm using only the ItemContextMenuDisplay event only. how to go into debug mode and check whether the selected item's context menu is getting added with my customized item. this is the code: Private Sub Application_ItemContextMenuDisplay(ByVal CommandBar As Office.CommandBar, ByVal Selection As Outlook.Selection) Static intCounter As Integer On Error GoTo ErrRoutine ' Increment or reset the counter If intCounter 1 Or intCounter 100 Then intCounter = 1 Else intCounter = intCounter + 1 End If ' Add the menu. Dim objMenu As Microsoft.Office.Core.CommandBarControl Dim cmbBar As Microsoft.Office.Core.CommandBar objMenu = cmbBar.Controls.Add(Office.MsoControlType.msoContr olButton) objMenu.Caption = "Displayed " & intCounter & " times" objMenu.Enabled = True objMenu.BeginGroup = True EndRoutine: On Error GoTo 0 Exit Sub ErrRoutine: MsgBox(Err.Number & " - " & Err.Description, _ vbOKOnly Or vbCritical, _ "Application_ItemContextMenuDisplay") GoTo EndRoutine End Sub please tell me what i'm missing. what else events i need to add...? i've given the references to Outlook 11.0 & 12.0 dlls and also to Office dll also. still i'm not able to see my item in the context menu. waiting for ur reply. Thanks & regards, Muppidi |
#6
|
|||
|
|||
![]()
Where are you running this code, it looks like it's in a VS project? How are
you adding the event handler? If you aren't getting compilation errors then you don't need any additional references. If your event handler isn't being called I'd suspect it isn't being added correctly. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Muppidi" wrote in message ... HI i was able to debug without any errors now. but this is just opening the outlook and going out of debug mode. thats it. its not hitting the break points. i'm using only the ItemContextMenuDisplay event only. how to go into debug mode and check whether the selected item's context menu is getting added with my customized item. this is the code: Private Sub Application_ItemContextMenuDisplay(ByVal CommandBar As Office.CommandBar, ByVal Selection As Outlook.Selection) Static intCounter As Integer On Error GoTo ErrRoutine ' Increment or reset the counter If intCounter 1 Or intCounter 100 Then intCounter = 1 Else intCounter = intCounter + 1 End If ' Add the menu. Dim objMenu As Microsoft.Office.Core.CommandBarControl Dim cmbBar As Microsoft.Office.Core.CommandBar objMenu = cmbBar.Controls.Add(Office.MsoControlType.msoContr olButton) objMenu.Caption = "Displayed " & intCounter & " times" objMenu.Enabled = True objMenu.BeginGroup = True EndRoutine: On Error GoTo 0 Exit Sub ErrRoutine: MsgBox(Err.Number & " - " & Err.Description, _ vbOKOnly Or vbCritical, _ "Application_ItemContextMenuDisplay") GoTo EndRoutine End Sub please tell me what i'm missing. what else events i need to add...? i've given the references to Outlook 11.0 & 12.0 dlls and also to Office dll also. still i'm not able to see my item in the context menu. waiting for ur reply. Thanks & regards, Muppidi |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
add item to context menu | Muppidi | Outlook - Using Forms | 0 | November 5th 08 12:30 PM |
add item to context menu | Muppidi | Outlook - Using Forms | 0 | November 5th 08 12:18 PM |
add new item in context menu | Muppidi | Outlook - Using Forms | 0 | November 5th 08 12:16 PM |
Add Item in Context Menu | Muppidi | Outlook - Using Forms | 0 | November 5th 08 12:13 PM |
Get context of context menu | sublimese | Add-ins for Outlook | 1 | October 17th 07 05:57 AM |