capture the Outlook 2013 Send event
I'm working on an application that should capture the Outlook 2013 Send event. I have used a C# project to do the required task.
In particular I have used following code to do this task
public Outlook.Application OutlookApplication;
public Outlook.Inspectors OutlookInspectors;
public Outlook.Inspector OutlookInspector;
public Outlook.MailItem OutlookMailItem;
public delegate void ApplicationEvents_11_ItemSendEventHandler(object Item, ref bool Cancel);
applicationObject = application;
addInInstance = addInInst;
OutlookApplication = application as Outlook.Application;
OutlookInspectors = OutlookApplication.Inspectors;
OutlookInspectors.NewInspector += new InspectorsEvents_NewInspectorEventHandler(OutlookInspectors_NewInspector);
OutlookApplication.ItemSend += new Outlook.ApplicationEvents_11_ItemSendEventHandler(OutlookMailItem_Send);
string strchkTo = OutlookMailItem.To;
string strchk = "hello Welcome to c#";
OutlookInspector = (Outlook.Inspector)Inspector;
if (Inspector.CurrentItem is Outlook.MailItem)
{
OutlookMailItem = (Outlook.MailItem)Inspector.CurrentItem;
}
c# vsto
add a comment |
I'm working on an application that should capture the Outlook 2013 Send event. I have used a C# project to do the required task.
In particular I have used following code to do this task
public Outlook.Application OutlookApplication;
public Outlook.Inspectors OutlookInspectors;
public Outlook.Inspector OutlookInspector;
public Outlook.MailItem OutlookMailItem;
public delegate void ApplicationEvents_11_ItemSendEventHandler(object Item, ref bool Cancel);
applicationObject = application;
addInInstance = addInInst;
OutlookApplication = application as Outlook.Application;
OutlookInspectors = OutlookApplication.Inspectors;
OutlookInspectors.NewInspector += new InspectorsEvents_NewInspectorEventHandler(OutlookInspectors_NewInspector);
OutlookApplication.ItemSend += new Outlook.ApplicationEvents_11_ItemSendEventHandler(OutlookMailItem_Send);
string strchkTo = OutlookMailItem.To;
string strchk = "hello Welcome to c#";
OutlookInspector = (Outlook.Inspector)Inspector;
if (Inspector.CurrentItem is Outlook.MailItem)
{
OutlookMailItem = (Outlook.MailItem)Inspector.CurrentItem;
}
c# vsto
I'm okay with that.
– Marco A.
Feb 7 '14 at 13:03
add a comment |
I'm working on an application that should capture the Outlook 2013 Send event. I have used a C# project to do the required task.
In particular I have used following code to do this task
public Outlook.Application OutlookApplication;
public Outlook.Inspectors OutlookInspectors;
public Outlook.Inspector OutlookInspector;
public Outlook.MailItem OutlookMailItem;
public delegate void ApplicationEvents_11_ItemSendEventHandler(object Item, ref bool Cancel);
applicationObject = application;
addInInstance = addInInst;
OutlookApplication = application as Outlook.Application;
OutlookInspectors = OutlookApplication.Inspectors;
OutlookInspectors.NewInspector += new InspectorsEvents_NewInspectorEventHandler(OutlookInspectors_NewInspector);
OutlookApplication.ItemSend += new Outlook.ApplicationEvents_11_ItemSendEventHandler(OutlookMailItem_Send);
string strchkTo = OutlookMailItem.To;
string strchk = "hello Welcome to c#";
OutlookInspector = (Outlook.Inspector)Inspector;
if (Inspector.CurrentItem is Outlook.MailItem)
{
OutlookMailItem = (Outlook.MailItem)Inspector.CurrentItem;
}
c# vsto
I'm working on an application that should capture the Outlook 2013 Send event. I have used a C# project to do the required task.
In particular I have used following code to do this task
public Outlook.Application OutlookApplication;
public Outlook.Inspectors OutlookInspectors;
public Outlook.Inspector OutlookInspector;
public Outlook.MailItem OutlookMailItem;
public delegate void ApplicationEvents_11_ItemSendEventHandler(object Item, ref bool Cancel);
applicationObject = application;
addInInstance = addInInst;
OutlookApplication = application as Outlook.Application;
OutlookInspectors = OutlookApplication.Inspectors;
OutlookInspectors.NewInspector += new InspectorsEvents_NewInspectorEventHandler(OutlookInspectors_NewInspector);
OutlookApplication.ItemSend += new Outlook.ApplicationEvents_11_ItemSendEventHandler(OutlookMailItem_Send);
string strchkTo = OutlookMailItem.To;
string strchk = "hello Welcome to c#";
OutlookInspector = (Outlook.Inspector)Inspector;
if (Inspector.CurrentItem is Outlook.MailItem)
{
OutlookMailItem = (Outlook.MailItem)Inspector.CurrentItem;
}
c# vsto
c# vsto
edited Feb 7 '14 at 13:03
Marco A.
35.2k1987190
35.2k1987190
asked Feb 7 '14 at 12:55
RameezAli
708911
708911
I'm okay with that.
– Marco A.
Feb 7 '14 at 13:03
add a comment |
I'm okay with that.
– Marco A.
Feb 7 '14 at 13:03
I'm okay with that.
– Marco A.
Feb 7 '14 at 13:03
I'm okay with that.
– Marco A.
Feb 7 '14 at 13:03
add a comment |
1 Answer
1
active
oldest
votes
The following steps works fine at my side.
- Create a Shared Add In. Choose Outlook to be the supported Application.
- In the Application Property page, set Outlook to be the start up program.
- Add a reference to Microsoft Outlook 11.0 Object Library.
Import the namespace:
using Outlook = Microsoft.Office.Interop.Outlook;
using System.Windows.Forms;
5.Replace the original system generated fields:
private object applicationObject;
private object addInInstance;
with the following new fields: (No ItemSend event)
public Outlook.Application OutlookApplication;
public Outlook.Inspectors OutlookInspectors;
public Outlook.Inspector OutlookInspector;
public Outlook.MailItem OutlookMailItem;
6.In the OnConnection method, replace all the system generated codes with the following ones:
OutlookApplication = application as Outlook.Application;
OutlookInspectors = OutlookApplication.Inspectors;
OutlookInspectors.NewInspector += new Microsoft.Office.Interop.Outlook.InspectorsEvents_NewInspectorEventHandler(OutlookInspectors_NewInspector);
OutlookApplication.ItemSend +=new Microsoft.Office.Interop.Outlook.ApplicationEvents_11_ItemSendEventHandler(OutlookApplication_ItemSend);
7.Add the event handler function OutlookInspectors_NewInspector:
void OutlookInspectors_NewInspector(Microsoft.Office.Interop.Outlook.Inspector Inspector)
{
OutlookInspector = (Outlook.Inspector)Inspector;
if (Inspector.CurrentItem is Outlook.MailItem)
{
OutlookMailItem = (Outlook.MailItem)Inspector.CurrentItem;
}
}
8.Add the event handler function OutlookApplication_ItemSend:
void OutlookApplication_ItemSend(object Item, ref bool Cancel)
{
string strchkTo = OutlookMailItem.To;
string strchk = "hello Welcome to c#";
MessageBox.Show(strchk + "rn" + strchkTo);
}
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f21628357%2fcapture-the-outlook-2013-send-event%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The following steps works fine at my side.
- Create a Shared Add In. Choose Outlook to be the supported Application.
- In the Application Property page, set Outlook to be the start up program.
- Add a reference to Microsoft Outlook 11.0 Object Library.
Import the namespace:
using Outlook = Microsoft.Office.Interop.Outlook;
using System.Windows.Forms;
5.Replace the original system generated fields:
private object applicationObject;
private object addInInstance;
with the following new fields: (No ItemSend event)
public Outlook.Application OutlookApplication;
public Outlook.Inspectors OutlookInspectors;
public Outlook.Inspector OutlookInspector;
public Outlook.MailItem OutlookMailItem;
6.In the OnConnection method, replace all the system generated codes with the following ones:
OutlookApplication = application as Outlook.Application;
OutlookInspectors = OutlookApplication.Inspectors;
OutlookInspectors.NewInspector += new Microsoft.Office.Interop.Outlook.InspectorsEvents_NewInspectorEventHandler(OutlookInspectors_NewInspector);
OutlookApplication.ItemSend +=new Microsoft.Office.Interop.Outlook.ApplicationEvents_11_ItemSendEventHandler(OutlookApplication_ItemSend);
7.Add the event handler function OutlookInspectors_NewInspector:
void OutlookInspectors_NewInspector(Microsoft.Office.Interop.Outlook.Inspector Inspector)
{
OutlookInspector = (Outlook.Inspector)Inspector;
if (Inspector.CurrentItem is Outlook.MailItem)
{
OutlookMailItem = (Outlook.MailItem)Inspector.CurrentItem;
}
}
8.Add the event handler function OutlookApplication_ItemSend:
void OutlookApplication_ItemSend(object Item, ref bool Cancel)
{
string strchkTo = OutlookMailItem.To;
string strchk = "hello Welcome to c#";
MessageBox.Show(strchk + "rn" + strchkTo);
}
add a comment |
The following steps works fine at my side.
- Create a Shared Add In. Choose Outlook to be the supported Application.
- In the Application Property page, set Outlook to be the start up program.
- Add a reference to Microsoft Outlook 11.0 Object Library.
Import the namespace:
using Outlook = Microsoft.Office.Interop.Outlook;
using System.Windows.Forms;
5.Replace the original system generated fields:
private object applicationObject;
private object addInInstance;
with the following new fields: (No ItemSend event)
public Outlook.Application OutlookApplication;
public Outlook.Inspectors OutlookInspectors;
public Outlook.Inspector OutlookInspector;
public Outlook.MailItem OutlookMailItem;
6.In the OnConnection method, replace all the system generated codes with the following ones:
OutlookApplication = application as Outlook.Application;
OutlookInspectors = OutlookApplication.Inspectors;
OutlookInspectors.NewInspector += new Microsoft.Office.Interop.Outlook.InspectorsEvents_NewInspectorEventHandler(OutlookInspectors_NewInspector);
OutlookApplication.ItemSend +=new Microsoft.Office.Interop.Outlook.ApplicationEvents_11_ItemSendEventHandler(OutlookApplication_ItemSend);
7.Add the event handler function OutlookInspectors_NewInspector:
void OutlookInspectors_NewInspector(Microsoft.Office.Interop.Outlook.Inspector Inspector)
{
OutlookInspector = (Outlook.Inspector)Inspector;
if (Inspector.CurrentItem is Outlook.MailItem)
{
OutlookMailItem = (Outlook.MailItem)Inspector.CurrentItem;
}
}
8.Add the event handler function OutlookApplication_ItemSend:
void OutlookApplication_ItemSend(object Item, ref bool Cancel)
{
string strchkTo = OutlookMailItem.To;
string strchk = "hello Welcome to c#";
MessageBox.Show(strchk + "rn" + strchkTo);
}
add a comment |
The following steps works fine at my side.
- Create a Shared Add In. Choose Outlook to be the supported Application.
- In the Application Property page, set Outlook to be the start up program.
- Add a reference to Microsoft Outlook 11.0 Object Library.
Import the namespace:
using Outlook = Microsoft.Office.Interop.Outlook;
using System.Windows.Forms;
5.Replace the original system generated fields:
private object applicationObject;
private object addInInstance;
with the following new fields: (No ItemSend event)
public Outlook.Application OutlookApplication;
public Outlook.Inspectors OutlookInspectors;
public Outlook.Inspector OutlookInspector;
public Outlook.MailItem OutlookMailItem;
6.In the OnConnection method, replace all the system generated codes with the following ones:
OutlookApplication = application as Outlook.Application;
OutlookInspectors = OutlookApplication.Inspectors;
OutlookInspectors.NewInspector += new Microsoft.Office.Interop.Outlook.InspectorsEvents_NewInspectorEventHandler(OutlookInspectors_NewInspector);
OutlookApplication.ItemSend +=new Microsoft.Office.Interop.Outlook.ApplicationEvents_11_ItemSendEventHandler(OutlookApplication_ItemSend);
7.Add the event handler function OutlookInspectors_NewInspector:
void OutlookInspectors_NewInspector(Microsoft.Office.Interop.Outlook.Inspector Inspector)
{
OutlookInspector = (Outlook.Inspector)Inspector;
if (Inspector.CurrentItem is Outlook.MailItem)
{
OutlookMailItem = (Outlook.MailItem)Inspector.CurrentItem;
}
}
8.Add the event handler function OutlookApplication_ItemSend:
void OutlookApplication_ItemSend(object Item, ref bool Cancel)
{
string strchkTo = OutlookMailItem.To;
string strchk = "hello Welcome to c#";
MessageBox.Show(strchk + "rn" + strchkTo);
}
The following steps works fine at my side.
- Create a Shared Add In. Choose Outlook to be the supported Application.
- In the Application Property page, set Outlook to be the start up program.
- Add a reference to Microsoft Outlook 11.0 Object Library.
Import the namespace:
using Outlook = Microsoft.Office.Interop.Outlook;
using System.Windows.Forms;
5.Replace the original system generated fields:
private object applicationObject;
private object addInInstance;
with the following new fields: (No ItemSend event)
public Outlook.Application OutlookApplication;
public Outlook.Inspectors OutlookInspectors;
public Outlook.Inspector OutlookInspector;
public Outlook.MailItem OutlookMailItem;
6.In the OnConnection method, replace all the system generated codes with the following ones:
OutlookApplication = application as Outlook.Application;
OutlookInspectors = OutlookApplication.Inspectors;
OutlookInspectors.NewInspector += new Microsoft.Office.Interop.Outlook.InspectorsEvents_NewInspectorEventHandler(OutlookInspectors_NewInspector);
OutlookApplication.ItemSend +=new Microsoft.Office.Interop.Outlook.ApplicationEvents_11_ItemSendEventHandler(OutlookApplication_ItemSend);
7.Add the event handler function OutlookInspectors_NewInspector:
void OutlookInspectors_NewInspector(Microsoft.Office.Interop.Outlook.Inspector Inspector)
{
OutlookInspector = (Outlook.Inspector)Inspector;
if (Inspector.CurrentItem is Outlook.MailItem)
{
OutlookMailItem = (Outlook.MailItem)Inspector.CurrentItem;
}
}
8.Add the event handler function OutlookApplication_ItemSend:
void OutlookApplication_ItemSend(object Item, ref bool Cancel)
{
string strchkTo = OutlookMailItem.To;
string strchk = "hello Welcome to c#";
MessageBox.Show(strchk + "rn" + strchkTo);
}
edited Nov 13 '14 at 11:47
Mike Fuchs
9,74024159
9,74024159
answered Feb 7 '14 at 13:09
Asif
2,3861423
2,3861423
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f21628357%2fcapture-the-outlook-2013-send-event%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I'm okay with that.
– Marco A.
Feb 7 '14 at 13:03