Accessing another custom form and the associated custom property

  • Thread starter Thread starter melon
  • Start date Start date
M

melon

Supposed I have a ItemA created with custom Form1, and ItemB created
with Form2.

Is it possible for ItemB to access user properties on ItemA? If so,
how do I open the ItemA in ItemB? Is there any item identifier that I
can use?
 
There are a few ways.

If the ItemB is selected you can access the ActiveExplorer.Selection
collection.

If the item is opened already you can iterate the Inspectors collection and
see which open Inspectors have your custom MessageClass or some identifying
tag and get a handle to the item that way.

If you know the folder the items would live in you can access the Items
collection of that MAPIFolder object and iterate that until you find the
item by MessageClass or some other identifier.

If you know ahead of time which items you might want to access you can store
their EntryID property and use NameSpace.GetItemFromID(EntryID) to get the
item.

Once you have the item you can access its UserProperties collection.
 
Back
Top