N
n777krish
Hello All,
I have added a combobox to the Outlook 2007 RibbonX.
Now as per the Outlook Com-addin samples (VB.Net samples), I am writing
a function to Find the Outlook Inspector that is currently selected
with-in the com addins inspectors collection. The function in VB 6.0
code is as follows:
************************************************************************************************
Private Function FindOutlookInspector(ByVal window As Object) As
clsInspWrap
Dim colInsp As clsInspWrap
Set FindOutlookInspector = Nothing
For Each colInsp In g_colInspWrap
If colInsp.Inspector Is window Then
Set FindOutlookInspector = colInsp
End If
Next colInsp
End Function
************************************************************************************************
The g_colInspWrap is the collection of inspectors that the addin
maintains.
The "colInsp.Inspector" returns an Outlook.Inspector object.
This line "If colInsp.Inspector Is window Then" never yields to True.
the "window" being passed into the function is the control.context that
gets passed into the callbacks.
Now, according to some tests that I carried out I observe the
following:
1. In the callback for a control if I compare "ActiveInspector Is
control.context" or vice-versa then this also yields false. Why
wouldn't this return true since both control.context and
ActiveInspector are referring to the same object?
2. In FindOutlookInspector function if I compare "colInsp.Inspector Is
golApp.ActiveInspector" (golApp is the global Outlook Application
object) instead of "window", then I observe that the ActiveInspector
still refers to the previous inspector when multiple are open and not
the one that I just clicked. I thought I could use the ActiveInspector
to find the appropriate inspector but this does not work because of
this problem.
What am i doing wrong? Why doesn't the code return true even when both
are refering to the same object?
Does control.context refer to some thing else? Has anyone been able to
write this successfully in VB6.0?
I am testing this code in Outlook 2007 Beta2. All the VB.Net sample's
indicate that this is how it is to be done but in VB6.0 i am finding it
different.
I would really appreciate the help and guidance.
Regards,
Neil Goundar.
I have added a combobox to the Outlook 2007 RibbonX.
Now as per the Outlook Com-addin samples (VB.Net samples), I am writing
a function to Find the Outlook Inspector that is currently selected
with-in the com addins inspectors collection. The function in VB 6.0
code is as follows:
************************************************************************************************
Private Function FindOutlookInspector(ByVal window As Object) As
clsInspWrap
Dim colInsp As clsInspWrap
Set FindOutlookInspector = Nothing
For Each colInsp In g_colInspWrap
If colInsp.Inspector Is window Then
Set FindOutlookInspector = colInsp
End If
Next colInsp
End Function
************************************************************************************************
The g_colInspWrap is the collection of inspectors that the addin
maintains.
The "colInsp.Inspector" returns an Outlook.Inspector object.
This line "If colInsp.Inspector Is window Then" never yields to True.
the "window" being passed into the function is the control.context that
gets passed into the callbacks.
Now, according to some tests that I carried out I observe the
following:
1. In the callback for a control if I compare "ActiveInspector Is
control.context" or vice-versa then this also yields false. Why
wouldn't this return true since both control.context and
ActiveInspector are referring to the same object?
2. In FindOutlookInspector function if I compare "colInsp.Inspector Is
golApp.ActiveInspector" (golApp is the global Outlook Application
object) instead of "window", then I observe that the ActiveInspector
still refers to the previous inspector when multiple are open and not
the one that I just clicked. I thought I could use the ActiveInspector
to find the appropriate inspector but this does not work because of
this problem.
What am i doing wrong? Why doesn't the code return true even when both
are refering to the same object?
Does control.context refer to some thing else? Has anyone been able to
write this successfully in VB6.0?
I am testing this code in Outlook 2007 Beta2. All the VB.Net sample's
indicate that this is how it is to be done but in VB6.0 i am finding it
different.
I would really appreciate the help and guidance.
Regards,
Neil Goundar.