Application.ActiveInspector.CurrentItem not set?

  • Thread starter Thread starter Simon Shaw
  • Start date Start date
S

Simon Shaw

See this simple bit of code...
<start>
Public Sub trainer_open()
Dim myItem As Outlook.ContactItem

Set myItem = Application.ActiveInspector.CurrentItem
<end>
This is called from the item_open event on a custom contact form.
When I create a new item, the assignment of CurrentItem does not seem to
take place - it results in myItem being set to Nothing, with resulting
problems later in the subroutine.

Why might this be?

TIA
Simon Shaw
 
I found I could get round this by adding "item.display" into the script on
the form.
Should this be necessary? Or is there a better way?
 
Unless you display the item, it will not be visible in the ActiveInspector
window.

How are you invoking the trainer_open procedure?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top