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

Direction/Help required for not to save MailItems in Sent Folder



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 26th 07, 04:05 PM posted to microsoft.public.outlook.program_addins
PS
external usenet poster
 
Posts: 35
Default Direction/Help required for not to save MailItems in Sent Folder

Hi

I am currently working on an Outlook addin devloped using C# and VSTO
2005. In the MailItem_ItemSend - all my custom logic takes place.

So the scenario i have is once i get the mailitem here - i do some
processing here (like based on the number of recicps) - I create copy
of orig emails (each having one recip) and then those emails actually
go out. The original email which the sender had clicked to send
does(should) not go out.

The problem(s) I am facing is a

1. How do I move the original email to Sent Items folder of the Sender
(so that the sender can refer the email again in its entirity for
future purposes)

2. I dont want the copies of email generated programatically to be
seen in Sent Items folder of the sender. How do i stop that from
happening.

Please - any help/direcction in this regard would really be helpful.

Thanks

  #2  
Old September 26th 07, 04:47 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Direction/Help required for not to save MailItems in Sent Folder

After cancelling the send you would have to save the item to make sure it
has an EntryID, then close the item after storing the EntryID and get the
item as a new item using NameSpace.GetItemFromID(), then use the Move method
to move it to Sent Items. Note that the item will not show up as sent, it
will be an unsent message.

Set the DeleteAfterSubmit property on each of the items that you don't want
put in Sent Items.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"PS" wrote in message
ups.com...
Hi

I am currently working on an Outlook addin devloped using C# and VSTO
2005. In the MailItem_ItemSend - all my custom logic takes place.

So the scenario i have is once i get the mailitem here - i do some
processing here (like based on the number of recicps) - I create copy
of orig emails (each having one recip) and then those emails actually
go out. The original email which the sender had clicked to send
does(should) not go out.

The problem(s) I am facing is a

1. How do I move the original email to Sent Items folder of the Sender
(so that the sender can refer the email again in its entirity for
future purposes)

2. I dont want the copies of email generated programatically to be
seen in Sent Items folder of the sender. How do i stop that from
happening.

Please - any help/direcction in this regard would really be helpful.

Thanks


  #3  
Old September 26th 07, 05:03 PM posted to microsoft.public.outlook.program_addins
PS
external usenet poster
 
Posts: 35
Default Direction/Help required for not to save MailItems in Sent Folder

Thanks a lot Ken for the quick response.

Regarding the first part - is all this possible through Outlook Object
Model (not want to use Redemption).

Also will look into code samples doing the apporach you have
mentioned. Is doing this normal - meaning no side issues related to
doing this manually (setting EntryID etc).

Just wanted to see ur thoughts on that

Thanks once agian

  #4  
Old September 26th 07, 07:18 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Direction/Help required for not to save MailItems in Sent Folder

You can use the Outlook object model for that. I have no idea what you mean
about setting the EntryID, Outlook creates the EntryID when you save the
item. Once it's saved and released you can re-open it and move it anywhere
you like.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"PS" wrote in message
ups.com...
Thanks a lot Ken for the quick response.

Regarding the first part - is all this possible through Outlook Object
Model (not want to use Redemption).

Also will look into code samples doing the apporach you have
mentioned. Is doing this normal - meaning no side issues related to
doing this manually (setting EntryID etc).

Just wanted to see ur thoughts on that

Thanks once agian


  #5  
Old September 28th 07, 12:29 AM posted to microsoft.public.outlook.program_addins
PS
external usenet poster
 
Posts: 35
Default Direction/Help required for not to save MailItems in Sent Folder

Ken

Thanks for the response. I now understand the Entry ID part but have
some issues with the real code implementation:

1. I looked for cancelling the Send event on the original email. Cant
seem to find any code. Can you please point this to me. I am really
having a hard time finding this.

Also I see this - myItem.SavveSentMessageFolder -- which i believe i
can use to save the email directly into the sent message folder. This
may avoid the MyItem.Save and then moving?

What do you suggest.

Thanks

  #6  
Old September 28th 07, 03:21 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Direction/Help required for not to save MailItems in Sent Folder

There are 2 possibilities for canceling a send. The first event is
item.Send, which fires initially when the user clicks send. That event is on
the MailItem and fires only in that item. The second event is the
Application.ItemSend event, which is an application-wide event.

In either event all you do is set Cancel = true to cancel the send
operation.

SaveSentMessageFolder takes a MAPIFolder as an argument and provides a way
of setting that one specific item to save in your folder of choice. The
property is only used after the after is sent out, so it's of no use when
cancelling a send. You could set that property to Drafts, My Old Outgoing
Mail, Sent Items, or wherever else you want.

DeleteAfterSubmit is a Boolean property that when set will delete the sent
item after it's sent out and leave no copies behind.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"PS" wrote in message
ups.com...
Ken

Thanks for the response. I now understand the Entry ID part but have
some issues with the real code implementation:

1. I looked for cancelling the Send event on the original email. Cant
seem to find any code. Can you please point this to me. I am really
having a hard time finding this.

Also I see this - myItem.SavveSentMessageFolder -- which i believe i
can use to save the email directly into the sent message folder. This
may avoid the MyItem.Save and then moving?

What do you suggest.

Thanks


  #7  
Old September 28th 07, 03:54 PM posted to microsoft.public.outlook.program_addins
PS
external usenet poster
 
Posts: 35
Default Direction/Help required for not to save MailItems in Sent Folder

I looked into this more all of last night - but cant seem to find
(sorry for my ignorance) - how to stop/cancel the send event of an
email and then close it properly. Even if it stays in inblx it is fine
because using the .Move method is very easy or as I mentioned
myItem.SavveSentMessageFolder possibly.

But please Ken - can you please point me how to do that

Thanks

 




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
Hot to speed up MailItems access Ivan Add-ins for Outlook 8 June 27th 07 06:39 PM
Move MailItems to another folder Gvaram Outlook and VBA 5 June 25th 07 01:46 PM
Could not save item. the form required to view this message cannot matt hullinger Outlook - Calandaring 1 February 20th 07 11:48 PM
Can someone point me in the right direction configuring Outlook To Sam Outlook - Installation 0 June 8th 06 03:25 AM
How To: select mailitems from my inbox? NFR Outlook - Using Forms 1 May 16th 06 04:41 PM


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