T
Tom Winter
I'm having a problem comparing objects from an Outlook 2003 COM Add-in. Take
the following code for example (it's contrived, but you get the idea):
If oOutlook.ActiveExplorer Is oOutlook.ActiveExplorer Then
MsgBox "Same"
Else
MsgBox "Different"
End If
From a VB6 COM Add-In, using the reference to the Outlook Application that
was passed into the COM Add-In, the code above will output "Different"! If
you do the same code from a regular VB6 application that uses GetObject() to
get the Outlook Application, the above code will output "Same".
Note that I never had this problem in Outlook 2002 or 2000.
I assume this is due to new security stuff in Outlook 2003, such as COM
Add-Ins being "trusted" as long as they use the Outlook Application object
passed to them. That's great, but how to I compare two objects? I need to
know if a reference to an Explorer that I have is the ActiveExplorer. I've
always used the "Is" operator to compare my reference with
Outlook.ActiveExplorer. Now that always fails. Is there any other way to do
that?
the following code for example (it's contrived, but you get the idea):
If oOutlook.ActiveExplorer Is oOutlook.ActiveExplorer Then
MsgBox "Same"
Else
MsgBox "Different"
End If
From a VB6 COM Add-In, using the reference to the Outlook Application that
was passed into the COM Add-In, the code above will output "Different"! If
you do the same code from a regular VB6 application that uses GetObject() to
get the Outlook Application, the above code will output "Same".
Note that I never had this problem in Outlook 2002 or 2000.
I assume this is due to new security stuff in Outlook 2003, such as COM
Add-Ins being "trusted" as long as they use the Outlook Application object
passed to them. That's great, but how to I compare two objects? I need to
know if a reference to an Explorer that I have is the ActiveExplorer. I've
always used the "Is" operator to compare my reference with
Outlook.ActiveExplorer. Now that always fails. Is there any other way to do
that?