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

Change value of To field in compose window



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 16th 08, 01:10 PM posted to microsoft.public.outlook.program_addins
Lokesh
external usenet poster
 
Posts: 1
Default Change value of To field in compose window

I have to change the value of "To" field in the compose/reply window in the send event method. The change occurs appropriately but,once the mail is sent, the item is placed in the sent folder but the recipient does not recieve the mail. If the mail is sent without changing the "To" field, it works fine. Can we not change the value of "To" field in send event?

I am using Applicaiton.ItemSend

Here is the code for it:
private void Composed_Mail_Send(Object obj, ref bool boolVar)
{
string assigneeStr = null;
Outlook.MailItem curItem;
MessageBox.Show("Send button clicked");

if (trackBtn.State == Office.MsoButtonState.msoButtonDown)
{
try
{
curItem = (Outlook.MailItem)curApp.ActiveInspector().Current Item;
assigneeStr = curItem.To;
curItem.RecipientReassignmentProhibited = false;
MessageBox.Show(curItem.To);
curItem.AlternateRecipientAllowed = true;
MessageBox.Show("Assignee:" +assigneeStr);
curItem.To = curBA.email;
MessageBox.Show("From:"+curItem.SenderEmailAddress
+"\n To:" +curItem.To);
curItem.Body = "/assignee:" + assigneeStr +
;
MessageBox.Show(curItem.Body);
}
catch (Exception exp)
{
MessageBox.Show(exp.StackTrace +"\n"+"Message:" + exp.Message);
}
}
}

  #2  
Old January 16th 08, 02:45 PM posted to microsoft.public.outlook.program_addins
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Change value of To field in compose window

Answered at http://www.outlookcode.com/threads.a...essageid=25439

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Lokesh" wrote in message ...
I have to change the value of "To" field in the compose/reply window in the send event method. The change occurs appropriately but,once the mail is sent, the item is placed in the sent folder but the recipient does not recieve the mail. If the mail is sent without changing the "To" field, it works fine. Can we not change the value of "To" field in send event?

I am using Applicaiton.ItemSend

Here is the code for it:
private void Composed_Mail_Send(Object obj, ref bool boolVar)
{
string assigneeStr = null;
Outlook.MailItem curItem;
MessageBox.Show("Send button clicked");

if (trackBtn.State == Office.MsoButtonState.msoButtonDown)
{
try
{
curItem = (Outlook.MailItem)curApp.ActiveInspector().Current Item;
assigneeStr = curItem.To;
curItem.RecipientReassignmentProhibited = false;
MessageBox.Show(curItem.To);
curItem.AlternateRecipientAllowed = true;
MessageBox.Show("Assignee:" +assigneeStr);
curItem.To = curBA.email;
MessageBox.Show("From:"+curItem.SenderEmailAddress
+"\n To:" +curItem.To);
curItem.Body = "/assignee:" + assigneeStr +
;
MessageBox.Show(curItem.Body);
}
catch (Exception exp)
{
MessageBox.Show(exp.StackTrace +"\n"+"Message:" + exp.Message);
}
}
}

 




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 permanently remove a toolbar from compose window ZenMasta Outlook - General Queries 2 October 23rd 07 07:31 PM
Compose window not closing after hitting send. [email protected] Outlook Express 14 April 13th 07 03:46 AM
NEED TO CHANGE NUMERIC FIELD TO TEXT FIELD dancer Outlook - General Queries 0 February 10th 07 07:22 PM
Displaying the From field in outgoing email (as I compose) John Elliott Outlook - Installation 1 October 13th 06 05:52 PM
What is the Contacts field used for in the task window? tarrykin Outlook - General Queries 1 March 24th 06 01:59 PM


All times are GMT +1. The time now is 09:02 PM.


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.