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!
Printable View
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!
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
VB Code:
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