![]() |
| If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|||||||
| Tags: email, folder, inbox, move, public, subfolder |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hello everyone,
just wounder is it possible to write a macro to move an e-mail to a subfolder in public folder ? I would like to have a button on the top of my outlook 2003 so that when I click on that button, it will move a selected e-mail to a subfolder in public folder. I am not a programmer, any help will be really appreciated. thanks |
| Ads |
|
#2
|
|||
|
|||
|
Are you at least comfortable with working in the VBA Editor? You'll need
some experience there to construct the following: - First select the Public Folder you want to move a message to and run this: Sub GetEntryIDsForCurrentFolder() Debug.Print "EntryID: " & Application.ActiveExplorer.CurrentFolder.EntryID Debug.Print "StoreID: " & Application.ActiveExplorer.CurrentFolder.StoreID End Sub Then use those values for the const# variables in the procedure below: Sub MoveSelectedMessageToConfiguredFolder() On Error GoTo MoveToPublicFolder_Error Dim objPF As Outlook.MAPIFolder Dim constEntryID As String Dim constStoreID As String Dim objMsg As Object If Application.ActiveExplorer.Selection Is Nothing Or Application.ActiveExplorer.Selection.Count 1 Then MsgBox "Please select a single message to move.", vbOKOnly + vbExclamation, "Invalid Selection" Exit Sub End If constEntryID = "{YOUR FOLDER'S ENTRYID}" constStoreID = "{YOUR FOLDER'S STOREID}" Set objPF = Application.Session.GetFolderFromID(constEntryID, constStoreID) If objPF Is Nothing Then MsgBox "Invalid folder.", vbOKOnly + vbExclamation Exit Sub End If Set objMsg = Application.ActiveExplorer.Selection.item(1) objMsg.Move objPF On Error GoTo 0 Exit Sub MoveToPublicFolder_Error: MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure MoveSelectedMessageToConfiguredFolder of VBA Document ThisOutlookSession" Resume Next End Sub You can also map this macro to a custom button or run it manually. -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Mr555" wrote: Hello everyone, just wounder is it possible to write a macro to move an e-mail to a subfolder in public folder ? I would like to have a button on the top of my outlook 2003 so that when I click on that button, it will move a selected e-mail to a subfolder in public folder. I am not a programmer, any help will be really appreciated. thanks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Outlook move to public folder | wodahsehtmai@yahoo.com | Outlook and VBA | 10 | December 15th 06 03:39 PM |
| Help problems setting up rule to move email to a public folder | Dab | Outlook - General Queries | 0 | October 18th 06 02:09 AM |
| After I've moved a note from Inbox to folder A, I can't move it to Folder B. | david.f.jenkins@usa.net | Outlook - General Queries | 0 | August 9th 06 11:46 PM |
| How i export/copy/move messages in a public folder outlook 2003? | Olatunde R. Adeniran | Outlook - Using Contacts | 1 | May 3rd 06 07:51 PM |
| auto linking of Inbox subfolder with server folder | nemodat@gmail.com | Outlook and VBA | 1 | February 6th 06 10:09 PM |