none
How to find folder to store an incoming message RRS feed

  • Question

  • I have a fairly large number of folders (that I can't remember all the names). Some incoming messages I'd like to move to a more permanent folder.  I tried searching for a relevant name that I think the message belongs to and  get a list of messages.  Some of those messages are stored in the sub-folder to which I'm looking to move my current message.

    My problem is that from the list of messages that are the result of the search, there's no mention of the folder that CONTAINS the message.

    How can I find a folder by searching for a typical message held within that folder (and others - I can tell the folder I want if I can see a list).

    Ed Mitchell


    Edward E. L. Mitchell Phone: (239)415-7039 12214 Lakewood Court Fort Myers, FL 33908

    Saturday, September 24, 2016 8:10 PM

Answers

All replies

  • Hello Ed,

    The Outlook items have the Parent property which returns the parent Object of the specified object. So, you can try to cast it to the MAPIFolder class. See How to: Enumerate Folders and How to: Get a Folder Based on Its Folder Path for more information.

    Also you may find the Find/FindNext and Restrict methods of the Items class:

    How To: Use Find and FindNext methods to retrieve Outlook mail items from a folder (C#, VB.NET)

    How To: Use Restrict method to retrieve Outlook mail items from a folder

    The Application class provides the AdvancedSearch method which has the following benefits:

     - The search is performed in another thread. You don’t need to run another thread manually since the AdvancedSearch method runs it automatically in the background.
     - Possibility to search for any item types: mail, appointment, calendar, notes etc. in any location, i.e. beyond the scope of a certain folder. The Restrict and Find/FindNext methods can be applied to a particular Items collection (see the Items property of the Folder class in Outlook).
     - Full support for DASL queries (custom properties can be used for searching too). You can read more about this in the Filtering article in MSDN. To improve the search performance, Instant Search keywords can be used if Instant Search is enabled for the store (see the IsInstantSearchEnabled property of the Store class).
     - You can stop the search process at any moment using the Stop method of the Search class.

    Read more about the method in the Advanced search in Outlook programmatically: C#, VB.NET article.


    [custom.development]

    Sunday, September 25, 2016 3:11 PM
  • I'm lost in the Reply, Mark as Answer and I don't know how to comment on an answer. I tried to reply a week ago but this seems to have been lost. Here's a copy of my reply.

    I responded to the reply so say that I wasn’t trying to do this programmatically so this wasn’t really the answer to my question. However my reply seems to have disappeared. This was my reply copied from my Outbox.

     

    Eugene,

     

    I’m not trying to do this via a program, just by using Outlook itself.

     

    After my search for a string within my Outlook current mailbox I see a  list of possible matches that are within many of my Outlook folders. How can I tell what is the parent folder of one of these items just be manipulating the Outlook menu items. I looked to see if I could find the Parent property but there’s no menu action that I can find that will tell me this.

     

    Ed

     


    Edward E. L. Mitchell Phone: (239)415-7039 12214 Lakewood Court Fort Myers, FL 33908

    Monday, October 3, 2016 6:28 PM
  • Hello Ed,

    The forum is for developers. I'd suggest asking non-programming questions on the Microsoft Community or Outlook IT Pro Discussions forum instead. 


    [custom.development]

    • Marked as answer by Ed Mitchell Tuesday, October 4, 2016 3:18 PM
    Tuesday, October 4, 2016 12:48 PM