Quantcast
Channel: NetOffice - MS Office in .NET
Viewing all articles
Browse latest Browse all 1741

New Post: Accessing Inspector events in OutlookApi

$
0
0
Yes, this is the same problem. But Explorers don't have SelectionChange event. You need Explorer class.
For objects with events NetOffice have two clasess, one - with events and another - without events. For Explorer there are 2 classes:
_Explorer - without events
Explorer - with events.
Most of the time, NetOffice properties and methods return objects without events to save resources when you don't need events. But you can easily transform them into the objects with events.

This should be something like this (I din't code on vb.net for a few years, so there can be some syntax errors)

private WithEvents _explorer as Outlook.Explorer

  Public Sub OnStartupComplete(ByRef custom As System.Array) Implements IDTExtensibility2.OnStartupComplete
    dim e as Outlook._Explorer ' without events
    set e = _outlookApplication.ActiveExplorer
    set _explorer = new Explorer(explorer) ' now - with events
  End Sub

 Private Sub _explorer_SelectionChange(ByVal Explorer As Outlook.Explorer) Handles _explorer.SelectionChangeEvent
    'do something
  End Sub

Viewing all articles
Browse latest Browse all 1741

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>