Absolutely. Couldn't tell you off the top of my head, but if you have the
MSDN library I know there is an example that does exactly what you are
trying to do. It shows you how to move items from one folder to the next.
Here's how I did it in VB with outlook where I was moving items from one
folder to another. You can do this same thing with CDO.
Public Sub processEmails()
'Set the current folder to Inbox and return moFolder as inbox
Set moExplorer.CurrentFolder = moNamespace.GetDefaultFolder(olFolderInbox)
Set moFolder = moNamespace.GetDefaultFolder(olFolderInbox)
Set moFolder2 = moFolder.Folders("OtherFolder")
'Note that the Other folder is a subset of the Inbox folder. But you should
get the idea. . .
'Iterate through each e-mail in inbox. move it to OtherFolder
For Each moItem In moFolder.Items
moItem.Move moFolder2
Next moItem
End Sub
Hope this helps.
John Downing
www.pearls-etc.com
Quote:
> Hi All,
> I'm trying to set up my MAPI session so that all messages that I send
> are not saved in the "Sent Items" folder. Is it possible to do this
> programmatically using VB?
> Thanks in advance,
> Iain