msoutlook.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Change value of To field in compose window

 
Post new topic   Reply to topic    msoutlook.org Forum Index -> Outlook Programs Add-Ins
Author Message
Lokesh



Joined: 16 Jan 2008
Posts: 1

PostPosted: Wed Jan 16, 2008 11:10 am    Post subject: Change value of To field in compose window Reply with quote

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().CurrentItem;
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);
}
}
}

Archived from group: microsoft>public>outlook>program_addins
Back to top
View user's profile Send private message
Sue Mosher [MVP-Outlook]



Joined: 12 Aug 2007
Posts: 656

PostPosted: Wed Jan 16, 2008 1:45 pm    Post subject: Re: Change value of To field in compose window Reply with quote

Answered at http://www.outlookcode.com/threads.aspx?forumid=5&messageid=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 @TK2MSFTNGP02.phx.gbl...
>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().CurrentItem;
> 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);
> }
> }
> }
>

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Programmatically changing the message's sender field in MAPI Using outlook as a user, there are 2 ways to change the 'from' field, one is actually choosing or typing in address in the 'from' line, but that outputs a 'sent on behalf of' type of message. Using the Accounts drop-down changes the low-level fields. Th

How do I change data in a field across an array of contacts? I want to be able to change the data in a field across an array of selected contacts. I can do this easily within the Categories field. How can I do this in other fields such as User defined?

Compose Font I can't change the font that I want to reply to messages with, and compose messages with.

event notification when compose/reply page/form open hi all, i have made application that create button at outlook main form(i mean when outlook starts a main form is shown) i was able to receive message when outlook send receive button was clicked. by giving id of application event id 0x0000F003 it was in

Adding my own window Hello, How do I add my own window/pane to Outlook 2003 through VB.NET? Thanks in advance Simon Jefferies
Post new topic   Reply to topic    msoutlook.org Forum Index -> Outlook Programs Add-Ins All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group