Moving multiple Outlook messages from search results to a folder RRS feed

  • Question

  • Hi,

    I'm facing the following issue: after I have searched for Outlook (2003) messages in Windows 7 using 'kind:email... <query>" I get a search results window. From there I can select ONE message and right-click, and get a number of options among which 'copy to folder' and 'move to folder'. But if I select multiple messages I only get 'copy' and 'delete.'

    I was wondering whether it would be feasible to write a PowerShell script that would get the multiple messages[' references] from the clipboard and perform a 'move to folder' action for all of them at once.

    This is very common use case for me when I tidy up my Inbox and Sent Items folders.

    TIA for your help.

    Thursday, January 12, 2012 12:43 PM

All replies

  • Read this article: Moving messages to another folder with conditions

    I do not known PowerShel, but I think that U've got problem with counting in ogject during delete.

    Oskar Shon, Office System MVP

    Press if Helpful; Answer when a problem solved

    • Edited by VBAToolsMVP Thursday, January 12, 2012 2:25 PM add expl.
    Thursday, January 12, 2012 2:23 PM
  • I'm using Outlook 2010, but doing searches in Windows 7 doesn't show the same right-click options for me in the search results.  Regardless, this is more of a Windows SDK question:

    Windows Desktop Search Development Forum:

    Also see:

    Windows Search Overview:

    Eric Legault
    MVP (Outlook)
    About me...
    Friday, January 13, 2012 7:34 PM
  • Well... here at home I have Outlook 2010 and the right-click menu for multiple selected messages in a Windows Search results window also has only "copy" and "delete"...


    Saturday, January 14, 2012 9:56 AM
  • sba, are you read my article?
    Oskar Shon, Office System MVP

    Press if Helpful; Answer when a problem solved

    Saturday, January 14, 2012 11:25 AM
  • Now I have, but it doesn't fit my bill.

    I don't want to move all messages matching some criterion to a folder, but some messages I select manually from among the contents of a "search results" window.

    Furthermore, I have no clue as to how to retrieve the ids of messages selected from the "search results" window so that I could run some VBA code taking these ids as input.



    Saturday, January 14, 2012 11:35 AM
  • Once you've selected Copy from the right-click menu, you can simply navigate to the folder in which you want to paste the items and paste them (using CTRL-V).  This should be much more straight-forward than trying to implement a code solution for this.

    To move, just use Cut (CTRL-X) and then paste.  The keyboard shortcuts still work even though there isn't a Copy/Paste option in the menu.
    Tuesday, January 17, 2012 3:50 PM
  • But I want to Move items, not Copy!


    Tuesday, January 17, 2012 3:52 PM
  • I've just updated my original post.  To move, just cut and paste using keyboard shortcuts.

    Tuesday, January 17, 2012 3:56 PM
  • Well... in a "Search Results" window, Cltr+X does nothing, and the Edit menu (normally hidden, shown when hitting Alt) only has "Copy" and "Copy to folder" as enabled entries:

    Tuesday, January 17, 2012 4:33 PM
  • You'll have to look at the Windows Search SDK to see if the search results for e-mail items include the ID values that you'll need.  If they do, then you can incorporate the Outlook Object Model in whatever code you need to implement a shell extension for Windows Explorer in order to properly handle these e-mail messages.  You won't be able to use VBA.
    Eric Legault
    MVP (Outlook)
    About me...
    Tuesday, January 17, 2012 4:45 PM
  • Sorry, I misunderstood the search.  The Copy to folder also refers to a Windows folder rather than an Outlook folder.

    Is your aim to move items from Outlook into a folder in the file system?  If you do the search from within Outlook, you should be able to cut or copy the items.

    Tuesday, January 17, 2012 5:32 PM
  • Let's go back to square one, and tell my story again from the start.

    I need to move a number of Outlook messages from their current location (typically Inbox or Sent Items) to an Outlook folder.

    Because of Outlook 2003's limitations (see above), I cannot use Outlook's Find to search for the messages, but I use Windows Search instead.

    From the Search Results window, I can right-click one message and select "Move to folder", but I cannot multi-select messages and do "Move to folder".


    Tuesday, January 17, 2012 5:49 PM
  • Once again: you have to use the Windows Search SDK to extend Windows Explorer with your custom right-click options.  All code will be oustide of Outlook, as in you can't use an Outlook Add-in nor VBA.  You can though use the Outlook Object Model inside your custom search solution to get handles to these Outlook e-mails in the search results IF it exposes the EntryID values for each item.
    Eric Legault
    MVP (Outlook)
    About me...
    Tuesday, January 17, 2012 5:56 PM
  • Hi,

    I reviewed this thread, along with another parallel one you have on this question, and I'm afraid there's really no good answer here for Outlook 2003 (as others have said). I guess one option is to use Outlook 2010 at home to do your e-mail organizing. Or, if rules really cannot be used for Outlook 2003, you could develop a custom macro to try to implement that search logic and move the messages via the object model. Of course, there's probably some downsides to that approach (like maybe performance), but it should be theoretically possible.

    Bill Jacob - Microsoft Customer Service & Support - Developer Messaging
    • Proposed as answer by Bruce Song Wednesday, February 1, 2012 9:43 AM
    Wednesday, January 18, 2012 10:33 PM