none
Activating next\previous item RRS feed

  • Question

  • Hello,

     

    In my project I need to simulate in WinForms behavior one can observe in Inspectors window.

    Once you open inspector on a particular item. In the top left corner of the inspector there are two arrows allowing moving the inspector the next\previous item in the folder according to the view sort.

     

    Searching hard as I can, I haven't found anything that can give me the same functionality.

    Is there something I have missed?

     

    Thank you,

    Arthur.

    Sunday, June 24, 2007 7:22 PM

Answers

  • As I indicated, you'd have to use CommandBars or locate the item within the current sort.
    Monday, June 25, 2007 8:37 PM
    Moderator
  • That's one of the tradeoffs of the design decision that you've made to use your own Windows form instead of Outlook 2007 form regions. That said, it would take some testing to determine if the CommandBars approach even still works in Outlook 2007 for individual items. It does in VBA, but I've seen some reports that it doesn't in an add-in.
    Tuesday, June 26, 2007 11:28 AM
    Moderator

All replies

  • What about executing those commands using CommandBars?
    Sunday, June 24, 2007 8:22 PM
    Moderator
  • I can't, I'm using custom forms, completely overriding inspector functionality.

    Using VSTO I catch the open item event for my message class opening WinForm window which acts similar to inspector window in respect to item manipulation.

    In advance I must say that I cannot migrate from custom forms and I cannot use form regions.

    The project is currently in migration from outlook 2000 where there is "ActivateNext" function that gives this functionality and I need it's counterpart in outlook 2007.
    Sunday, June 24, 2007 8:44 PM
  • So you're using only Windows forms, not custom Outlook forms?

     

    I don't recall any ActivateNext method for any object in Outlook 2000 or any other version.

     

    Without an Inspector, the only other way to get the context for the "next" or "previous" item would be to determine how the view is sorted, return an Items collection with the same sort, and loop through it until you find the current item, so that you can then obtain the next or previous item in the filter to display. Not very efficient.

    Sunday, June 24, 2007 9:06 PM
    Moderator
  • I use both. A custom form is defined for custom fields which the user can use to customize the view and sort by them. I don't use custom forms to present the item itself.

    I use WinForms to replace Inspector functionality.

    I can't tell you right now the type of the object as it legacy code with little known about it. I will get back with some code samples. Though the code itself still works under outlook 2007 I really would like to upgrade to VSTO.

    I have considered the method you suggested but it's unacceptable as a single folder can contain tens of thousands of items.
    Sunday, June 24, 2007 9:40 PM
  • I have some difficulty retrieving the code from my organization.

    Checking again the code I can say; it's a COM add-in written by Microsoft (1999) with is installed with the custom form.

    And I found MSDN documentation for ActivateNext method:

    http://msdn2.microsoft.com/en-us/library/ms529361.aspx

     

    Thank you,

    Arthur.

    Monday, June 25, 2007 7:01 PM
  • The reference you posted is for Extended MAPI, which is the API underlying many Outlook operations. However, it is not supported in .NET languages nor is there any analogous method in the Outlook object model. To use it, you'd need to use C++ or Delphi to write a separate component and call that component from your add-in.

    Monday, June 25, 2007 7:08 PM
    Moderator
  • There is nothing in Exchange / Outlook 2007 that can give me the same functionality in managed code?

    Monday, June 25, 2007 7:19 PM
  • As I indicated, you'd have to use CommandBars or locate the item within the current sort.
    Monday, June 25, 2007 8:37 PM
    Moderator
  • How can I use command bar if the inspector window is never created?
    Tuesday, June 26, 2007 5:35 AM
  • That's one of the tradeoffs of the design decision that you've made to use your own Windows form instead of Outlook 2007 form regions. That said, it would take some testing to determine if the CommandBars approach even still works in Outlook 2007 for individual items. It does in VBA, but I've seen some reports that it doesn't in an add-in.
    Tuesday, June 26, 2007 11:28 AM
    Moderator
  • Well, it's a migration project, the decision was made a long time ago (not that it possible to develop the project with form regions).

    Thank you for your help,

    Arthur.

    Tuesday, June 26, 2007 12:00 PM