Sorting Outlook Calender by Specific Tasks or Events RRS feed

  • Question

  • Hi Guys

    We currently have a law office product in the market that combines both case management and accounting procedures in one to give you a complete package. The system does not have its own calender, however it is designed to click an appointment button internally which then opens in outlook and gives you the ability to the set the appointment up in Outlook.

    I have a client who are lawyers and they want to view their calenders by specific events, with the ability to hide all other events. This meaning he wants the ability to see for the next 2 months how many court appearances he has only and hide all other info on the calender or he may want to see 3 or 4 specific events only with the ability to hide all other info.

    Anyone with any ideas on how to do this would be much appreciated

    Wednesday, April 16, 2014 2:10 PM


All replies

  • Hello Malcolm,

    You can use Search folders. You can read more about this in the How To Search Folders with the SetSearchCriteria Method article.

    There three main ways for searching Outlook items:

    1. Use the Find/FindNext methods. See How To: Retrieve Outlook calendar items using Find and FindNext methods.

    2. Use the Restrict method. See How To: Use Restrict method in Outlook to get calendar items for more information.

    3. Advanced search. Allows to store the results in a search folder: The AdvancedSearch method and related features in the Outlook object model do not create a Search Folder that will appear in the Outlook user interface. However, you can use the Save method of the Search object that is returned to create a Search Folder that will appear in the Search Folders list in the Outlook user interface. See Advanced search in Outlook programmatically: C#, VB.NET for more information.  

    Wednesday, April 16, 2014 2:20 PM
  • Hi Eugene

    Thanks that was very insightful, However when a search is triggered, the display is in list view and I would like to keep it in calender view.

    This is because the lawyer from a visual perspective wants to ensure that he does not over plan his week as some tasks take more time than others, for example he wants to only have 2 discoveries a week and with a list view it restricts the planning. If i go to views and select change view, then select calender it says "outlook does not support this view"

    Any suggetsions

    Wednesday, April 16, 2014 4:15 PM
  • Hi Malcolm,

    You can customize the current view of the calendar folder in Outlook. The CurrentView property of the Explorer or Folder class. To obtain a View object for the view of the current Explorer, use Explorer.CurrentView instead of the CurrentView property of the current Folder object returned by Explorer.CurrentFolder. To properly reset the current view, you must do a View.Reset and then a View.Apply:

    Sub ResetView()  
     Dim v as Outlook.View  
     ' Save a reference to the current view object  
     Set v = Application.ActiveExplorer.CurrentView
     ' Reset and then apply the current view  
    End Sub 

    The View class provides the Filter property which sets a string value that represents the filter for a view. For example:

    Private Sub FilterViewToLastWeek()  
     Dim objView As View 
     ' Obtain a View object reference to the current view.  
     Set objView = Application.ActiveExplorer.CurrentView 
     ' Set a DASL filter string, using a DASL macro, to show 
     ' only those items that were received last week.  
     objView.Filter = "%lastweek(""urn:schemas:httpmail:datereceived"")%" 
     ' Save and apply the view.  
    End Sub 

    Wednesday, April 16, 2014 8:51 PM