Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move Email from One Account To Another

Status
Not open for further replies.

SaturnSeven

Programmer
Aug 4, 2005
40
GB
I am trying to move emails from the Send Items folder of one account to a specific folder in another account.
I can loop through the emails I am trying to move OK, I can move them to a folder in the same account, but I can not figure out how to them to a different account.

How can this be done.

Any help / pointers would be greatly appreciated

Here's my code so far
' Set Variables
'Account 1
Dim ns As NameSpace
Dim SendItems As MAPIFolder
Dim Item As Object
Set ns = GetNamespace("MAPI")
Set SendItems = ns.GetDefaultFolder(olFolderSentMail)

'Account 2
Dim MoveTo As MAPIFolder
'Set MoveTo = ns.Folders("MoveTo")

'Loop
For Each Item In SendItems.Items
Debug.Print Item.Subject
'Item.Move MoveTo
Next

Set ns = Nothing
 
try GetSharedDefaultFolder("other users id",folder)[/]

Never knock on Death's door: ring the bell and run away! Death really hates that!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top