Google Answers Logo
View Question
 
Q: Outlook 2003 macro - move read messages from inbox ( No Answer,   1 Comment )
Question  
Subject: Outlook 2003 macro - move read messages from inbox
Category: Computers > Programming
Asked by: and0-ga
List Price: $12.00
Posted: 21 Sep 2006 11:43 PDT
Expires: 21 Oct 2006 11:43 PDT
Question ID: 767350
I'm looking for a macro for Outlook 2003 that will move all read
messages from my inbox to another folder.  I don't want a rule that
does this; I'd like something I can run by clicking a button.  I've
looked on a few Outlook macro sites, but can't find anything that
specifically pertains to this.

To sum up, I want to click a button in Outlook and have all read
messages moved from my inbox to another folder.  Thanks!

Request for Question Clarification by rainbow-ga on 21 Sep 2006 12:37 PDT
I'm not sure if these pages will help, but take a look and let me know:

http://www.fiftyfoureleven.com/weblog/general/outlook-email-shortcuts

http://firechewy.com/blog/archive/2006/04/12/973.aspx

http://www.outlookcode.com/threads.aspx?forumid=5&messageid=16516

Best regards,
Rainbow

Clarification of Question by and0-ga on 21 Sep 2006 12:58 PDT
Thanks for the information!  The third link on the list looks like it
would work (specifically, the corrected code lower in the thread).  I
want the macro to only apply to read items, and to leave unread items
untouched.  It seems there is a specific part of that macro which
performs this, but I'm not entirely sure.  I don't have any experience
with Outlook macros.  Can you confirm that this macro will do that? 
Thanks!

Request for Question Clarification by rainbow-ga on 21 Sep 2006 13:11 PDT
Since I'm not very good with macros either, I'm not sure which part of
the code applies to your specific request.

Hopefully another researcher will be able to clarify.

Best regards,
Rainbow

Clarification of Question by and0-ga on 21 Sep 2006 13:18 PDT
Thank you, I've moved the question to the programming category as that
seems more applicable.
Answer  
There is no answer at this time.

Comments  
Subject: Re: Outlook 2003 macro - move read messages from inbox
From: c0r3dump-ga on 18 Oct 2006 01:11 PDT
 
I think this is what you need, the only change you have to do is to
change the _Temp with the name of the destination folder:

Sub MoveUnreadMessagesToFolder()
On Error Resume Next

    Const olFolderInbox = 6

    Set objOutlook = CreateObject("Outlook.Application")
    Set objNamespace = objOutlook.GetNamespace("MAPI")
    Set objFolderSrc = objNamespace.GetDefaultFolder(olFolderInbox)
    Set objFolderDst = objFolderSrc.Folders("_Temp")

    Set colItems = objFolderSrc.items
    Set colFilteredItems = colItems.Restrict("[UnRead] = False")

    For Each objMessage In colFilteredItems
        objMessage.Move objFolderDst
    Next

End Sub

I have test it in my own Outlook 2003 and seems to work fine. Hope
this were what you are looking for

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy