Z
Zane
Hi,
I have created an addin for Outlook 2002in c# .net, the
purpose of the addin is that it allows the user to extract
a mail item (email) into a 3rd party application as a
document, when the addin has completed this extraction, I
would like to prefix the subject title of the email back
in Outlook with a note, this works intermittently, all I
do is set the mail item's subject property to include the
prefix:
string oSubject = "Email added - ";
oSubject += oMail.Subject;
oMail.Subject = oSubject;
oMail.Save();
oMail = null;
As I mentioned, this works sometimes and sometimes it
doesn't. But when it does work, Outlook hangs at the
oMail.Save() line for a while, but after around 10-15
seconds, it's ok. What is causing this hanging?
Then what I tried doing was setting the mail items subject
first to an empty string, then saving it, and then setting
the subject to the desired title:
string oSubject = "Email added - ";
oSubject += oMail.Subject;
oMail.Subject = "";
oMail.Save();
oMail.Subject = oSubject;
oMail.Save();
oMail = null;
Now this works all the time now, but what happens now
baffles me. When I start Outlook for the first time, and
try to extract the email, Outlook hangs for a long time,
(at the first oMail.Save() ) line, but eventually it un-
hangs and it works fine, but everytime after that when I
try to extract an email, it's really quick, no hanging. So
it's only when I try running the addin for the first time
everytime I start Outlook.
Can someone tell me what's going on and if there is a fix
for it?
Thanks Heaps
I have created an addin for Outlook 2002in c# .net, the
purpose of the addin is that it allows the user to extract
a mail item (email) into a 3rd party application as a
document, when the addin has completed this extraction, I
would like to prefix the subject title of the email back
in Outlook with a note, this works intermittently, all I
do is set the mail item's subject property to include the
prefix:
string oSubject = "Email added - ";
oSubject += oMail.Subject;
oMail.Subject = oSubject;
oMail.Save();
oMail = null;
As I mentioned, this works sometimes and sometimes it
doesn't. But when it does work, Outlook hangs at the
oMail.Save() line for a while, but after around 10-15
seconds, it's ok. What is causing this hanging?
Then what I tried doing was setting the mail items subject
first to an empty string, then saving it, and then setting
the subject to the desired title:
string oSubject = "Email added - ";
oSubject += oMail.Subject;
oMail.Subject = "";
oMail.Save();
oMail.Subject = oSubject;
oMail.Save();
oMail = null;
Now this works all the time now, but what happens now
baffles me. When I start Outlook for the first time, and
try to extract the email, Outlook hangs for a long time,
(at the first oMail.Save() ) line, but eventually it un-
hangs and it works fine, but everytime after that when I
try to extract an email, it's really quick, no hanging. So
it's only when I try running the addin for the first time
everytime I start Outlook.
Can someone tell me what's going on and if there is a fix
for it?
Thanks Heaps