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 » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Custom Add-In for Outlook Mail



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 4th 08, 06:46 AM
pavanmuppidi pavanmuppidi is offline
Junior Member
 
First recorded activity at Outlookbanter: Nov 2008
Posts: 6
Question Custom Add-In for Outlook Mail

Hi

When i right click on a Outlook Mail, along with the other existing options i need to get one option like "Status" under which two sub-options like "Approve" and "Reject" should be there.

Upon selecting the Approve or Reject option, i should be able to automatically update a field in my database as "1" for Approve and "0" for Reject.

Can anyone help me in this regard.

Thanks in advance.

Regards,
Muppidi.
  #2  
Old November 4th 08, 03:02 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Custom Add-In for Outlook Mail

Outlook version?

For Outlook 2003 or earlier you can hack something that will fire when an
item in the folder view (Explorer) is clicked, but you won't be able to tell
which item was clicked or even if the click was on an item or somewhere else
like the Navigation Pane. So that's pretty useless for what you want.

For Outlook 2007 there are new context menu events that fire from the
Application object, the one you'd want would be the ItemContextMenuDisplay()
event. That tells you which item or items were selected when the right-click
occurred. See the Object Browser Help on that event to see how it works.

--
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


"pavanmuppidi" wrote in message
news

Hi

When i right click on a Outlook Mail, along with the other existing
options i need to get one option like "Status" under which two
sub-options like "Approve" and "Reject" should be there.

Upon selecting the Approve or Reject option, i should be able to
automatically update a field in my database as "1" for Approve and "0"
for Reject.

Can anyone help me in this regard.

Thanks in advance.

Regards,
Muppidi.




--
pavanmuppidi


  #3  
Old November 5th 08, 11:31 AM
pavanmuppidi pavanmuppidi is offline
Junior Member
 
First recorded activity at Outlookbanter: Nov 2008
Posts: 6
Default

i'm trying to work out with VS 2005 and Outlook 2007.

can u brief me the steps to acheive this task or any helpful links .

still no progress from my side

trying with reference of this but getting errors.

http://msdn.microsoft.com/en-us/library/bb175110.aspx

looking forward for ur reply

Regards,
Muppidi.
  #4  
Old November 5th 08, 04:58 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Custom Add-In for Outlook Mail

Yes, that's exactly what you need to use and the link has VBA code to use
the event. Have you tried pasting that code into your VBA project and
modifying it and then testing with that?

What errors are you getting? Did you try translating that VBA sample code to
whatever language you're using (either VB.NET or C#)? What code are you
trying to use?

--
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


"pavanmuppidi" wrote in message
news

i'm trying to work out with VS 2005 and Outlook 2007.

can u brief me the steps to acheive this task or any helpful links .

still no progress from my side

trying with reference of this but getting errors.

http://msdn.microsoft.com/en-us/library/bb175110.aspx

looking forward for ur reply

Regards,
Muppidi.




--
pavanmuppidi


  #5  
Old November 6th 08, 07:11 AM
pavanmuppidi pavanmuppidi is offline
Junior Member
 
First recorded activity at Outlookbanter: Nov 2008
Posts: 6
Question

Private Sub Application_ItemContextMenuDisplay(ByVal CommandBar As Office.CommandBar, ByVal Selection As 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 Object
objMenu = CommandBar.Controls.Add(msoControlButton)
objMenu.Caption = "Displayed " & intCounter & " times"
objMenu.Enabled = False
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

i'm getting error at

1) "Selection" (Type Selection is not defined)
2) "msoControlButton" (msoControlButton name not defined.)

i would like to do this in C#.Net. (or VB.Net)

could u suggest me to resolve this.

Regards,
Muppidi.

Last edited by pavanmuppidi : November 6th 08 at 07:14 AM.
  #6  
Old November 6th 08, 07:18 AM
pavanmuppidi pavanmuppidi is offline
Junior Member
 
First recorded activity at Outlookbanter: Nov 2008
Posts: 6
Question

public void OnConnection(object application, Extensibility.ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
applicationObject = (Outlook.Application)application;
addInInstance = addInInst;

applicationObject.FolderContextMenuDisplay += new
Microsoft.Office.Interop.Outlook.ApplicationEvents _11_FolderContextMenuDisplayEventHandler(
applicationObject_FolderContextMenuDisplay);
}

void applicationObject_FolderContextMenuDisplay(Microso ft.Office.Core.CommandBar commandBar, Microsoft.Office.Interop.Outlook.MAPIFolder folder)
{
CommandBarButton button = (CommandBarButton)commandBar.Controls.Add(
MsoControlType.msoControlButton, 1, Type.Missing,
commandBar.Controls.Count - 1, true );
// Exception occurs on next line:
button.Tag = folder.EntryID + ";" + folder.StoreID;
button.Caption = "My Command";
}

this is the other piece of code i've tried.
but @ Extensibility.ext_ConnectMode , the error is coming.
MISSING NAMESPACE OR TYPE.
these are the namespaces i've used.
using System;
using System.Windows.Forms;
using Microsoft.VisualStudio.Tools.Applications.Runtime;
using Outlook = Microsoft.Office.Interop.Outlook;
using Office = Microsoft.Office.Core;

I'm totally new to these concepts. plz help.
where is the mistake?


Regards,
Muppidi.
 




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 create and call Microsoft Custom Form in Outlook 2003 Mail? Naval kishore Outlook - Using Forms 1 May 8th 08 01:53 PM
How to have custom mail forms integrated to Outlook? MeAgin Outlook - Using Forms 3 December 11th 06 12:22 PM
Creating Custom Mail Form Sam Outlook - Using Forms 3 September 19th 06 07:40 PM
automatically send e-mail when closing a custom outlook form Keefo Outlook - Using Forms 1 May 27th 06 02:22 PM
Custom Mail Fields Ian Mackenzie Outlook and VBA 2 March 31st 06 02:50 PM


All times are GMT +1. The time now is 11:12 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.