ArthurTep

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.



Re: Visual Studio Tools for Office Activating next\previous item

Sue Mosher - Outlook MVP

What about executing those commands using CommandBars



Re: Visual Studio Tools for Office Activating next\previous item

ArthurTep

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.




Re: Visual Studio Tools for Office Activating next\previous item

Sue Mosher - Outlook MVP

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.





Re: Visual Studio Tools for Office Activating next\previous item

ArthurTep

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.




Re: Visual Studio Tools for Office Activating next\previous item

ArthurTep

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.





Re: Visual Studio Tools for Office Activating next\previous item

Sue Mosher - Outlook MVP

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.





Re: Visual Studio Tools for Office Activating next\previous item

ArthurTep

There is nothing in Exchange / Outlook 2007 that can give me the same functionality in managed code





Re: Visual Studio Tools for Office Activating next\previous item

Sue Mosher - Outlook MVP

As I indicated, you'd have to use CommandBars or locate the item within the current sort.



Re: Visual Studio Tools for Office Activating next\previous item

ArthurTep

How can I use command bar if the inspector window is never created



Re: Visual Studio Tools for Office Activating next\previous item

Sue Mosher - Outlook MVP

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.



Re: Visual Studio Tools for Office Activating next\previous item

ArthurTep

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.