Attach digital Signature with code

A

andyoye

I have a button on a win form that launches outlook and auto populates To:,
Subject:, Attachment:.... How can I attach digital signature so when users
click the button, it attaches their signatures.

Code Sample:

Outlook.Application outlookApp = new Outlook.Application();

Outlook.MailItem message =
(Outlook.MailItem)outlookApp.CreateItem(Outlook.OlItemType.olMailItem);

message.Subject = attachName;

message.To = msgTo;...............

Thanks
 
K

Ken Slovak - [MVP - Outlook]

There's nothing in the Outlook object model that supports digital signing.
If the users have a command bar button or ribbon control for signing you
could call the Execute method on that control to sign but that's about it.
 
A

andyoye

How can I can call execute method on them? We do have command bar
button/ribbon control.
 
K

Ken Slovak - [MVP - Outlook]

You get that button (CommandBarButton) object, which has an Execute method.
You will need the ID for the CommandBarButton, to use with the Find method
to instantiate that button. You can use a tool such as OutlookSpy
(www.dimastr.com) to open an Inspector viewer on an open Inspector and then
go to the CommandBars tab to find your button ID. I believe there's also a
list of some ID's at www.outlookcode.com and sample code there to get ID's.
I don't use a signing certificate for my emails so I don't know that ID
myself.

For ribbon controls you would use the ribbon XML references to find the
idMso for that control in the type of Inspector you want to deal with (for
example mail compose) and once you have that you can use the
CommandBars.ExecuteMso method with the idMso to execute the ribbon control.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top