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

move mailitem in ItemSend



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 26th 07, 03:00 PM posted to microsoft.public.outlook.program_addins
shubhangi
external usenet poster
 
Posts: 28
Default move mailitem in ItemSend

hi!
I need to copy mailitem to other folder when it is sent.I used
Application_ItemSend event
used below code

'added Xheaders to the item
Item.save
Item.Move(ObjFolder) 'ObjFolder set to copy folder
Item gets moved to this folder But When I open that mailitem it doesn't show
me Xheader info
as well as I get "This message has not been sent" heading above the
message.It is shown as compose mail msg.Do I need to use then
SentItems_ItemAdd event to make a copy or is there
any other way to do this in vb.net?
I'm using Outlook 2007 & VSTO addin
Thanks


Ads
  #2  
Old October 26th 07, 07:09 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default move mailitem in ItemSend

Moving an item being sent would certainly confuse Outlook: Move() returns a
brand new item in the target folder, while Outlook will keep trying to send
the current item.
Secondly, when ItemSend event fires, the item hasn't been sent yet, so no
sender relatred props are available and it is still in teh unsent state.

Why not simply set the MailItem.SaveSentMessageFolder property to the folder
where the item is supposed to be saved after submission?

Item.SaveSentMessageFolder = ObjFolder

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"shubhangi" wrote in message
...
hi!
I need to copy mailitem to other folder when it is sent.I used
Application_ItemSend event
used below code

'added Xheaders to the item
Item.save
Item.Move(ObjFolder) 'ObjFolder set to copy folder
Item gets moved to this folder But When I open that mailitem it doesn't
show me Xheader info
as well as I get "This message has not been sent" heading above the
message.It is shown as compose mail msg.Do I need to use then
SentItems_ItemAdd event to make a copy or is there
any other way to do this in vb.net?
I'm using Outlook 2007 & VSTO addin
Thanks



  #3  
Old October 29th 07, 02:35 PM posted to microsoft.public.outlook.program_addins
sd[_2_]
external usenet poster
 
Posts: 69
Default move mailitem in ItemSend

Thanks !! Item.SaveSentMessageFolder worked

On Oct 26, 11:09 pm, "Dmitry Streblechenko"
wrote:
Moving an item being sent would certainly confuse Outlook: Move() returns a
brand new item in the target folder, while Outlook will keep trying to send
the current item.
Secondly, when ItemSend event fires, the item hasn't been sent yet, so no
sender relatred props are available and it is still in teh unsent state.

Why not simply set the MailItem.SaveSentMessageFolder property to the folder
where the item is supposed to be saved after submission?

Item.SaveSentMessageFolder = ObjFolder

Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"shubhangi" wrote in message

...



hi!
I need to copy mailitem to other folder when it is sent.I used
Application_ItemSend event
used below code


'added Xheaders to the item
Item.save
Item.Move(ObjFolder) 'ObjFolder set to copy folder
Item gets moved to this folder But When I open that mailitem it doesn't
show me Xheader info
as well as I get "This message has not been sent" heading above the
message.It is shown as compose mail msg.Do I need to use then
SentItems_ItemAdd event to make a copy or is there
any other way to do this in vb.net?
I'm using Outlook 2007 & VSTO addin
Thanks- Hide quoted text -


- Show quoted text -



  #4  
Old October 29th 07, 02:36 PM posted to microsoft.public.outlook.program_addins
sd[_2_]
external usenet poster
 
Posts: 69
Default move mailitem in ItemSend

On Oct 26, 11:09 pm, "Dmitry Streblechenko"
wrote:
Moving an item being sent would certainly confuse Outlook: Move() returns a
brand new item in the target folder, while Outlook will keep trying to send
the current item.
Secondly, when ItemSend event fires, the item hasn't been sent yet, so no
sender relatred props are available and it is still in teh unsent state.

Why not simply set the MailItem.SaveSentMessageFolder property to the folder
where the item is supposed to be saved after submission?

Item.SaveSentMessageFolder = ObjFolder

Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"shubhangi" wrote in message

...



hi!
I need to copy mailitem to other folder when it is sent.I used
Application_ItemSend event
used below code


'added Xheaders to the item
Item.save
Item.Move(ObjFolder) 'ObjFolder set to copy folder
Item gets moved to this folder But When I open that mailitem it doesn't
show me Xheader info
as well as I get "This message has not been sent" heading above the
message.It is shown as compose mail msg.Do I need to use then
SentItems_ItemAdd event to make a copy or is there
any other way to do this in vb.net?
I'm using Outlook 2007 & VSTO addin
Thanks- Hide quoted text -


- Show quoted text -


Thanks It worked

 




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
Move MailItem John Tripp Outlook and VBA 2 June 22nd 07 05:07 AM
Cancelling and closing a mailitem in itemsend event bstrum Add-ins for Outlook 1 June 19th 07 05:53 AM
MailItem.Move changes Received Date Frank Perugini Outlook and VBA 1 January 21st 07 11:27 PM
MailItem.Move changes Received Date Frank Perugini Add-ins for Outlook 1 January 21st 07 11:27 PM
How can I create a MailItem that displays like a received MailItem ? Clive Outlook - Using Forms 0 February 27th 06 04:14 PM


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