Encrypt Message in Outlook
Keywords: Encrypt email Message Outlook
Sample code:
IntControl(73, 2, 0, 0, 0) myOlApp = ObjectOpen("Outlook.Application") olMailItem = 0 myItem = myOlApp.CreateItem(olMailItem) myInspector = myItem.GetInspector myInspector.Display oCBs = myInspector.CommandBars DigitalSigCtrl = 719 EncryptMsgCtrl = 718 oDigSignCtl = oCBs.FindControl(,EncryptMsgCtrl) If oDigSignCtl==0 ;Add the toolbar button to the item. myStandardItem = oCBs.Item("Standard") myCtrls = myStandardItem.Controls oDigSignCtl = myCtrls.Add(, EncryptMsgCtrl,,,@True) EndIf ; Check to make sure the button is not dimmed. If oDigSignCtl.Enabled != @False ;Check to make sure the button is not depressed. If oDigSignCtl.State == 0 Then oDigSignCtl.Execute Else Message("You do not have a support for encrypted messages!","This mail will not be sent.") ;Cancel the send to only allow sending of signed mail. exit End If ObjectClose(oCBs) ObjectClose(oDigSignCtl) ObjectClose(myOlApp) exit :WBERRORHANDLER IntControl(73, 2, 0, 0, 0) %wberrorhandlerassignment% = 0 Return
Article ID: W15244