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

Forward and ReplyAll issue



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 27th 07, 06:52 PM posted to microsoft.public.outlook.program_addins
Alphagmale
external usenet poster
 
Posts: 2
Default Forward and ReplyAll issue

I have created a VSTO add-in that will take the selected message and
will attempt to execute forward or replyall depending upon the menu
command selected. The whole purpose of this exercise is to take a
standard email, convert to a new message class and update the user
properties (special fields) of the message.

The selected message is copied, its message class is changed and then
it is moved to a temporary personal folder (ConvertToIFGMessage).
Toward the later part of the processing the temporary folder is
scanned for all messages and presented to the user for editing
(SendIFGMessage).

My question and problem concerns the fact that both the ReplyAll and
Forward are returning a NULL reference. Can you offer any clues?
Even better is there a way to trace exactly what is happening?

private void ConvertToIFGMessage(Outlook.MailItem mail)
{
try
{
Outlook.MailItem copyMail = mail.Copy() as
Outlook.MailItem;

copyMail.MessageClass = "IPM.Note.IFGXChange";
copyMail.Save();

copyMail.Move(_oIFGDrafts);

Marshal.ReleaseComObject(copyMail);
copyMail = null;
}
catch (Exception ex)
{
System.Diagnostics.Trace.WriteLine(ex.Message);
_ifgTechListener.Flush();
}

return;
}


private void SendIFGMessage(_eSendType eSendType)
{
try
{
foreach (object obj in _oIFGDrafts.Items)
{
if (obj is Outlook.MailItem)
{
Outlook.MailItem ifgDraftMail = obj as
Outlook.MailItem;
Outlook.MailItem ifgMail = null;

if(eSendType == _eSendType.eSTForward)
{
ifgMail =
((Outlook._MailItem)ifgDraftMail).Forward();
ifgMail.CC =
ifgDraftMail.SenderEmailAddress + ";" +
ifgDraftMail.To.ToString() + ";" +
ifgDraftMail.CC.ToString();
ifgMail.Body = "Message Forwarded to
IFGTech For Review" + ifgMail.Body.ToString();
}
else
{
ifgMail =
((Outlook._MailItem)ifgDraftMail).ReplyAll();
ifgMail.CC = ifgDraftMail.CC.ToString() +
";" + "P-US-Interfaces Tech";
Outlook.UserProperty uDateTimeProp =
ifgMail.UserProperties.Add("DateResponded",
Outlook.OlUserPropertyType.olDateTime, _Missing, _Missing);
uDateTimeProp.Value = System.DateTime.Now;

Outlook.UserProperty uRespondedProp =
ifgMail.UserProperties.Add("Responded",
Outlook.OlUserPropertyType.olYesNo, _Missing, _Missing);
uRespondedProp.Value = true;
}

ifgMail.Display(true);
ifgDraftMail.Delete();
}
}
}
catch (Exception ex)
{
System.Diagnostics.Trace.WriteLine(ex.Message);
_ifgTechListener.Flush();
}
}

#region VSTO generated code

/// summary
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// /summary
private void InternalStartup()
{
this.Startup += new
System.EventHandler(ThisAddIn_Startup);
this.Shutdown += new
System.EventHandler(ThisAddIn_Shutdown);
}

#endregion
}
}

Ads
 




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
forward Sam Outlook - General Queries 4 January 29th 07 07:22 PM
How to setup a rule to forward rule in Outlook (xp or 2003) to forward emails from a certain domain when app isnt running? KingCronos Outlook - General Queries 7 November 15th 06 11:22 AM
forward inline morilla_s Outlook Express 1 September 5th 06 02:58 PM
how to disable "forward" and "replyall" on an email programitcaly Ravikanth Outlook - Using Forms 1 August 10th 06 04:44 PM
forward as icalendar kirsty Outlook - Calandaring 1 March 20th 06 02:30 PM


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