Application.ActiveInspector.CurrentItem not set?

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
 
S

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?
 
S

Sue Mosher [MVP-Outlook]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top