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 » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Move send mails from special account



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old November 23rd 06, 09:41 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 1
Default Move send mails from special account

Hy together,

im getting really mad with VBA in Outlook 2003.

Im trying to check when a mail has been send from which account it was
send. After that I want to move the sent mail in a special folder if
the sender is ....

Im trying it with this code....

Option Explicit
Public WithEvents SentItems As Outlook.Items
Private Sub Application_Startup()
Set SentItems = _
Outlook.Session.GetDefaultFolder(olFolderSentMail) .Items
End Sub
Private Sub Application_Quit()
Set SentItems = Nothing
End Sub
Private Sub SentItems_ItemAdd(ByVal Item As Object)
Select Case Item.From
Case " ' folder1
Item.Move
Outlook.Session.GetDefaultFolders(olFolderInbox).F olders("TEST")
Case " ' folder2
Item.Move
Outlook.Session.GetDefaultFolders(olFolderInbox).F olders("TEST2")
Case Else ' Leave it in the top Inbox
Item.Move Outlook.Session.GetDefaultFolders(olFolderInbox)
End Select
End Sub

Can someone help me please!!! Thanks really for any suggestion....

 




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 move send mails to secondary mailbox Gvaram Outlook and VBA 4 October 3rd 06 05:45 AM
move account to another computer Leslie Outlook - Using Contacts 4 February 28th 06 04:39 PM
Outlook 2003 changes the outgoing account when unable to send by selected account HeidarV Outlook - General Queries 1 January 16th 06 02:26 PM
Outlook 2003 changes the outgoing account when unable to send by selected account HeidarV Outlook - General Queries 0 January 14th 06 08:44 AM


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