Security manager not working?

Add-in Express™ Support Service
That's what is more important than anything else

Security manager not working?
 
Julian Pointer


Guest


Hi,
Im trying to turn warning messages off, the code below dosnt work? I get the "Allow Acces for" prompt from outlook.

var
oOutlook : TOutlookApplication;
oItems : _items;
oMail : mailitem;
i,j : integer;
sSQL : widestring;
iID : integer;
iEA_id : integer;
sTo : TSplitArray;
sCC : TSplitArray;
begin

oOutlook := TOutlookApplication.Create(self);
oItems := oOutlook.GetNamespace('MAPI').GetDefaultFolder(olFolderInbox).Items;


try
OlSecurityManager1.DisableOOMWarnings := true;
for i := 1 to oItems.Count do
begin

oItems.Item(i).QueryInterface(IID__MailItem, oMail);
if assigned(oMail) then
oMail.SaveAs('c:\msg\' + oMail.EntryID + '.msg', olMsg);

end;
finally
OlSecurityManager1.DisableOOMWarnings := false;
end;

Posted 21 Jun, 2005 16:35:07 Top
Julian Pointer


Guest


Fixed it... sorry should read the manual first, missed the ConnectTo


try
OlSecurityManager1.ConnectTo(oOutlook.Application);
OlSecurityManager1.DisableOOMWarnings := true;
Posted 21 Jun, 2005 16:50:33 Top
Dmitry Kostochko


Add-in Express team


Posts: 2740
Joined: 2004-04-05
Hi Julian,

You did everything absolutely right, it is necessary to call the ConnectTo method in a standalone application (not a COM add-in).
Posted 22 Jun, 2005 06:41:45 Top
Gürcan YÜCEL




Posts: 52
Joined: 2004-08-16
Hi,
Im wrote an outlook add-in and also I want to get rid of "Allow Acces for" dialog. I looked the code above but cant understand.
My Part of code is here;
var
IDsp : IDispatch;
...

IDsp := OutlookApp.ActiveExplorer.Selection.Item(i);
IDsp.QueryInterface(IID__MailItem,TmpMailItem); <--- Get message here.


How can I creata OlSecurityManager?
Posted 01 Jul, 2005 10:01:34 Top
Gürcan YÜCEL




Posts: 52
Joined: 2004-08-16
I looked for your site and saw that its standalone product.
Thanks.
Posted 01 Jul, 2005 10:07:10 Top
Dmitry Kostochko


Add-in Express team


Posts: 2740
Joined: 2004-04-05
Hi Gürcan,

You can put the component on the TForm. Outlook Security Manager has the SendMail demo project that may be useful for you.
Posted 01 Jul, 2005 10:33:13 Top