Click to See Complete Forum and Search --> : Copy message to (public) folder
Glacks
Jun 9th, 2006, 05:28 AM
Hi all,
I'm a VBA newbie and would like to create an Outlook 2003 macro to copy a selected e-mail message in my inbox or sent items folder to a specific public folder. Can anyone give me a code snippet how to do this?
Many thanks!
Static
Jun 9th, 2006, 10:03 AM
this might at least start u in the right direction:
this shows u how to grab the inbox.. and how to list all the folders in Public FOlders > All Public Folders
Public Function MoveMail(toFldr As String)
Dim FLD1 As MAPIFolder
Dim FLD2 As MAPIFolder
Dim FLDRS As MAPIFolder
Set FLD1 = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
Set FLD2 = Application.GetNamespace("MAPI").Folders("Public Folders").Folders("All Public Folders")
For Each FLDRS In FLD2.Folders
Debug.Print FLDRS.Name
DoEvents
Next
End Function
Private Sub test()
MoveMail "Test"
End Sub
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.