
Signature
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
Hello Sue,
First things first, I would just like to think you for taking the time to
help me out with my problem.
In regards to adding a BCC I ended up using a collaboration of your advice
and the advice from another reply in a separate newsgroup.
This is what it looks like to those who would like to know.
Dim str As String
Dim Recip As Outlook.Recipient
str = OMF.Send(Item, applicationObject)
Recip = Item.Recipients.Add(str)
Recip.Type = 3 ' 3 = BCC
Item.Recipients.ResolveAll()
Cancel = False
str = Nothing
Recip = Nothing
This is using VB.NET which I should have specified in my original post but
this works fine.
Now the problem still lies in the "Object Model Guard" I followed the link
you left for me (thx again) and I spent the better part of the day reading
that article and almost all of the articles that spawned from that one. Now
I must say I am more confused now then ever. I have written a "Windows
Service" using VB.NET that will populate an "Exchange" folder with contacts
from a SQL DB and I didn't run into any of these problems. Basically what I
think could be a source of the problem is that when the OnConnection sub is
called
Public Sub OnConnection(ByVal application As Object, ByVal connectMode
As Extensibility.ext_ConnectMode, ByVal addInInst As Object, ByRef custom As
System.Array) Implements Extensibility.IDTExtensibility2.OnConnection
It is getting application as "ByVal" which is creating a new un-trusted
application object. Is there a way for me to change that to "ByRef" and then
just pass that "trusted" application object around to my functions to do the
required processing?
If not would you happen to maybe have an example of bypassing this "Object
Modal Guard" that you wouldn't mind sharing?
Once again thanks
- Adam
1) See http://www.outlookcode.com/d/sec.htm for your options with regard to
the "object model guard" security in Outlook 2000 SP2 and later versions.
2) Use MailItem.Recipients.Add, not MailItem.Bcc, and resolve the recipient.

Signature
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
> Hey Guys,
>
[quoted text clipped - 127 lines]
>
> - Adam
Sue Mosher [MVP-Outlook] - 19 Oct 2005 23:18 GMT
You have it wrong, I'm afraid. The application object passed by the OnConnection event *is* "trustable" with regard to the Outlook "object model guard." But only Outlook 2003 supports the concept of "trusted" add-ins on standalone machines. In an Exchange environment, an add-in can be trusted for all versions that support trusted add-ins using the Outlook Security Settings public folder. For a .NET add-in, you will need a shim and will trust the shim using the security settings form.
For add-ins that must support multiple versions and multiple environments, the best solution would be to write your own Extended MAPI component to handle the methods you need, but that's not a .NET project. As a VB/VB.NET programmer, I use Redemption in my projects, and you'll find plenty of samples on the Redemption web site.

Signature
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
> Hello Sue,
>
[quoted text clipped - 48 lines]
>
> 2) Use MailItem.Recipients.Add, not MailItem.Bcc, and resolve the recipient.
>> Hey Guys,
>>
[quoted text clipped - 127 lines]
>>
>> - Adam