tags:

views:

68

answers:

1

Hi,

I'm opening Outlookelements with the shown Code (scroll down; C# Code). Sometimes the elements don't come to front so you first have to select them. Any idea how to do this? I thought about the handle and doing this by hand.

Other idea's?

Thanks Thomas

MAPIFolder objFolder = new ApplicationClass().GetNamespace("MAPI").GetDefaultFolder(OlDefaultFolders.olFolderNotes);
                foreach (NoteItem note in objFolder.Items)
                    note.Display(false);
A: 

Hi,

If you are calling from another app you will have to handle the Hwnd, you can do this via Win API calls or you can use Redemption's SafeInspector which which has an Handle property.

Here is a link how to get the hWnd via WinApi http://theflaker.com.ar/blog/?p=10

76mel
Thanks for advice. Can try it next week.I'm calling this from an external program!
Thomas Spranger
No worries hope it works for you, Redemption is a great lib if you work with mapi / exchange outlook etc.
76mel
Thanks, its great! Works perfectly ;) Bye
Thomas Spranger