Re: Move sent emails




All sorted, thanks.

Dim IMAPSentFolder As MAPIFolder
Private WithEvents olSentItems As Items

Private Sub Application_Startup()
Dim MySent As Object
Set objNS = Application.GetNamespace("MAPI")
Set MySent = objNS.GetDefaultFolder(olFolderSentMail)
Set IMAPSentFolder = objNS.Folders("Brian's Mail").Folders("Sent")
Set olSentItems = MySent.Items
End Sub

Private Sub olSentItems_ItemAdd(ByVal Item As Object)
Item.Move IMAPSentFolder
End Sub

Private Sub Application_Quit()
Set objNS = Nothing
Set MySent = Nothing
Set olSentItems = Nothing
Set IMAPSentFolder = Nothing
End Sub


--
Brian Tetlow
------------------------------------------------------------------------
Brian Tetlow's Profile: http://www.highdots.com/forums/m1516
View this thread: http://www.highdots.com/forums/t3125810

.