Outlook New Mail security settings

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

Outlook New Mail security settings
try to change the security settings of the new e-mail from Add-in insp 
Julian M


Guest


Hi Dmitry and Eugene,

I know you can find a solution of my problem. :(
In outlook when a new mail form is opened I try to change the security settings of the new e-mail from Add-in inspector buttons in this form. Could you tell me how to rich those settings from OutlookApp or if you have a better way?Â?Ð??
I can do this from everywhere but the changes won?Â?Ð?ét be applied to the current opened new mail. I want to have functionality as sign and encrypt buttons in Outlook 2000 and Outlook express. Thanks in advance.

JM
Posted 09 Mar, 2005 19:26:16 Top
Dmitry Kostochko


Add-in Express team


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

As far as I remember the Outlook Object Model does not provide direct support for programmatically signing or encrypting mail messages.

I can do this from everywhere but the changes won?Â?Ð?ét be applied to the current opened new mail.

What do you mean? You can change this manually via Options->Security Settings dialog, can't you?



Posted 10 Mar, 2005 07:15:51 Top
Julian M


Guest


Hi Dmitry,

I think that I found the way to change them dynamically. But I have problem with attachments . Below I listed the example code . Could you correct it. The goal is to copy one mail in other. Thanks

JM

var
    iMail,iMail1: MailItem;
    imail2:IDispatch;
    MsgStore: IRwMapiMsgStore;
    OutBox: IRwMapiFolder;
    NewMessage: IRwMapiMessage;
    i:integer;
begin
 if Assigned(Item) then
  begin
    Item.QueryInterface(IID__MailItem, iMail);
    if Assigned(iMail) then
    try
     Cancel:=true;
     imail2:=OutlookApp.CreateItem(olMailItem);
     imail2.QueryInterface(IID__MailItem,imail1);
     iMail1.To_:=iMail.To_;
     iMail1.Subject:=iMail.Subject;
     iMail1.Body:=iMail.Body;
     for i:=0 to iMail.Attachments.Count-1 do
      begin
         iMail1.Attachments.Add(iMail.Attachments.Item(i).FileName,iMail.Attachments.Item(i).type_,iMail.Attachments.Item(i).Position,iMail.Attachments.Item(i).DisplayName);
      end;

     iMail1.Send;
     iMail.Close(olDiscard);

    finally
    end;
  end;
Posted 10 Mar, 2005 23:46:33 Top
Dmitry Kostochko


Add-in Express team


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

The first error I have found in the following code:
for i := 0 to iMail.Attachments.Count - 1 do

Try this code:
for i := 1 to iMail.Attachments.Count do


Posted 11 Mar, 2005 03:16:46 Top