I can't help with VB.NET, I don't have that high a threshold of pain
It does look like I left out some module level declarations that should be
there, I'll go over that code and post a revised wrapper example over the
weekend.
Randy didn't include an Inspector wrapper in his example, ItemsCB, because a
working Inspector wrapper hadn't yet been developed when he wrote that
sample. That wasn't developed until we did some work on a commercial project
together. ItemsCB will be updated at some point to include an Inspector
wrapper as well as lots of other things. We don't have a target date for
that however, it depends on when we can find the time to work on it.
Reb DeWinter said:
Hi, Dmitry!
I've tried porting the Slovak code you directed me to into my COM Add-In,
but it is not going well. First of all, the Slovak code is VB 6.0 and I'm
using VB.Net so I'm having to make several adjustments and things are coming
up missing - like variables that were never declared so I'm not sure if they
are VB 6.0 default variables or just variables that need to be declared.
Second, I'm wondering why Randy Byrne would not have included similar
functionality in his COM Add-In sample if it was necessary. Maybe just
because the sample code does not use inspector menus? Or is it obsolete in
VB.Net? So before I spend several more hours trying to integrate this new
code into my COM Add-in I wanted to confirm with you that I'm adding the
right stuff in the right places. and maybe get some insite into some of the
syntax errors:
I integrated the code from Slovak's
Private Sub colInsp_NewInspector(ByVal Inspector As Inspector)
sub into the OlInspector_NewInspector sub in my OutAddIn class (similar to
the one used in Byrne's example).
Then I created a new class called clsInspWrap.vb and a new module called
basOutInsp.vb to house the code he references for the inspector wrapper just
as he suggests. In the clsInspWrap.vb class, the following variables are
showing as never being declared:
m_strMailID, m_strContactID, strKey, m_oControlBar. I can't find them
declared as pulblic variables anywhere else in his code so should I add
public declarations for them at the class or module level?
I also had to change the property statements to update them to VB.Net - does this look correct?
Public Property MailItem(ByVal objMail As Outlook.MailItem)
Set(ByVal Value)
m_objMail = objMail
m_blnMailInspector = True
m_strMailID = objMail.EntryID
End Set
Get
Return m_objMail
Return m_blnMailInspector
Return m_strmailid
End Get
End Property
Public Property ContactItem(ByVal objContact As Outlook.ContactItem)
Set(ByVal Value)
m_objContact = objContact
'm_strContactID = objContact.Importance
m_blnMailInspector = False
End Set
Get
Return m_objContact
'Return m_strcontactid
Return m_blnMailInspector
End Get
End Property
Public Property Inspector(ByVal objInspector As Outlook.Inspector)
Set(ByVal Value)
m_objInsp = objInspector
'
End Set
Get
'Return m_objInsp
Inspector = m_objInsp
Return Inspector
End Get
End Property
Public Property Key(ByVal lngID As Long)
Set(ByVal Value)
m_intID = lngID
End Set
Get
Key = m_intID
'Return m_intID
Return Key
End Get
End Property
In the basOutInsp.vb module, it doesn't like some of the syntax and I'm
not quite sure what to do with it. For example, Slovak's code has this
statement: