Renat Tlebaldziyeu

Outlook Security Manager deployment: overview

In this series of articles I will try to cover all possible ways of deploying your applications that use Outlook Security Manager, for all Outlook versions. In fact, deployment for Outlook 2000 – 2007 as well as Outlook 2010, 32-bit is practically the same, and only deploying for Outlook 2010, 64-bit has some peculiarities.

As you probably know the package of Security Manager 2010 for Microsoft Outlook includes 3 editions: .NET, VCL and ActiveX. Two editions of Outlook Security Manager 2010, .net and ActiveX, support Microsoft Outlook 2010, 32-bit and 64-bit, while the VCL edition supports Outlook 2010 x86 only. Let’s go though all of them and we’ll start with .net.

.NET edition deployment

Used technology / Project type Outlook 2000-2007 Outlook 2010
(x86)
Outlook 2010
(x64)
Outlook Object Model COM Add-in Platform target: AnyCPU
Deploy and register: secman.dll
Platform target: AnyCPU
Deploy and register: secman64.dll
Application Platform target: x86
Deploy and register: secman.dll
Platform target: x64
Deploy and register: secman64.dll
Simple MAPI COM Add-in Platform target: AnyCPU
Deploy and register: secman.dll
Platform target: AnyCPU
Deploy and register: secman64.dll
Application Platform target: x86
Deploy and register: secman.dll
Platform target: x64
Deploy and register: secman64.dll
CDO COM Add-in Platform target: AnyCPU
Deploy and register: secman.dll
? Not supported by Microsoft
Application Platform target: x86
Deploy and register: secman.dll
? Not supported by Microsoft

In the table above, you can find a target platform, against which you develop your software (COM Add-in or a standalone application) and our redistributable library that should be registered on a target PC depending on the Outlook version and technology that you use in your code.

Note. For standalone applications (not an Outlook add-in!), the bitness of the application must be the same as that of Outlook, but not the bitness of the operating system.

To deploy your software that uses Outlook Security Manager 2010 .net edition:

  1. Your setup package is to include the SecurityManager.2005.dll assembly. This assembly should be placed into a folder where all your deployed assemblies are located.
  2. Your setup package must include two redistributable libraries: secman.dll and secman64.dll. Please pay attention that you need to place secman.dll and secman64.dll as shared DLLs into the shared folder of Windows, "[Common Files Folder]\Outlook Security Manager". You can find the redistributable version of secman.dll and secman64.dll in the Redistributables subfolder of the Outlook Security Manager installation folder.
  3. You need to register one of secman dlls as a COM object depending on the Outlook version installed on the target PC. You register secman64.dll for Outlook 2010 64-bit only, for other versions it’s secman.dll. Be aware that administrative permissions are required to register secman.dll or secman64.dll. To register them, you can use the regsvr32 utility or special options of your installer.

That seems to be all with .net, let’s move to ActiveX now.

ActiveX edition deployment

Used technology / Project type Outlook 2000-2007 Outlook 2010
(x86)
Outlook 2010
(x64)
Outlook Object Model COM Add-in or Outlook macros Platform target: x86
Deploy and register: osmax.ocx, secman.dll
Platform target: x64
Deploy and register: osmax64.ocx, secman64.dll
Application
Simple MAPI COM Add-in or Outlook macros
Application
CDO COM Add-in or Outlook macros Platform target: x86
Deploy and register: osmax.ocx, secman.dll
? Not supported by Microsoft
Application Platform target: x86
Deploy and register: osmax.ocx, secman.dll
? Not supported by Microsoft

The same as for .net, the table above shows a target platform for your software (COM Add-in or a standalone application) and our redistributable library that should be registered on a target PC.

To deploy your software that uses Outlook Security Manager ActiveX edition:

  1. If you compile you software for the “x86” platform, include the secman.dll and osmax.ocx files in your setup package. After that you register them on an end-user machine as COM objects.
  2. If you compile your software for the “x64” platform you should include the secman64.dll and osmax64.ocx files to your setup package. You must register them on an end-user computer as a COM objects.

As you can see, there are 2 pairs of Security Manager files: secman.dll and osmax.ocx are 32-bit; secman64.dll and osmax64.ocx are 64-bit. They are available in the Redistributables folder. In order to use them, you need to register them first, and only an administrator can do this. All installation software allows registering COM DLLs, please see the corresponding option of your software. Also, you can run the regsvr32.exe command:

For registering:
Regsvr32.exe {path}\{your dll}

For unregistering:
Regsvr32.exe /u {path}\{your dll}

Since the Security Manager files must be accessible by all users on the PC, you should place them as shared DLLs into a shared location, we recommend this folder – “[Common Files Folder]\Outlook Security Manager”.

VCL edition deployment

Used technology / Project type Outlook 2000-2007 Outlook 2010 (x86) Outlook 2010 (x64)
Outlook Object Model COM Add-in Platform target: x86
Deploy and register: secman.dll
Not supported by Embarcadero
Application
Simple MAPI COM Add-in
Application
CDO COM Add-in Platform target: x86
Deploy and register: secman.dll
? Not supported by Microsoft
Application Platform target: x86
Deploy and register: secman.dll
? Not supported by Microsoft

To deploy your software that uses Outlook Security Manager VCL edition:

Include the secman.dll file to your setup package and register it on an end-user computer as a COM object. To register it, you can use the regsvr32 utility or special options of your installer. Don’t forget to place secman.dll as a shared DLL into the shared folder of Windows, "[Common Files Folder]\Outlook Security Manager".

Unfortunately, we (and consequently, you) cannot support Outlook 2010 x64 for VCL, because Delphi doesn't have an x64-compiler yet.

“Why is it always question marks for CDO in all the three tables above?” you can ask. Because, as stated in the What’s New for Developers in Outlook 2010 article in MSDN "CDO does not install with Outlook 2010, and is available only as a download. CDO 1.2.1 is a 32-bit client library and will not operate with 64-bit Outlook 2010. Therefore, CDO 1.2.1 is not supported for use with Outlook 2010. Most of the CDO 1.2.1 functionality has been incorporated into the Outlook 2010 object model. As an alternative to CDO 1.2.1, update existing solutions that depend on CDO to use the Outlook object model or to use MAPI directly." So, even if your software that uses CDO does work in Outlook 2010 x86, I would still recommend rebuilding it using alternative ways, for example the Outlook Object Model.

You may also be interested in:

Outlook Security Manager deployment: bitness and regsvr32 utility, part 2
Outlook Security Manager deployment: self-registration in a Visual Studio setup project, part 3
Outlook Security Manager deployment: compiling a standalone application with "AnyCPU", part 4

2 Comments

  • Clive Newell says:

    Outlook Security Manager 2007 works fine on Windows XP with MS 2003 Office Loaded.

    Outllook Security Manager 2010 also works fine on Windows XP with MS 2003 Office Loaded.

    Keep getting the following error on a Window 7 64bit PC with MS Office 2010 32 bit loaded.

    Run Time Error 429: ActiveX component can’t create object.

    Running from MS Access 2010. See code below

    Function EmailStatements() As Boolean
    EmailStatements = False
    On Error GoTo EmailStatementsErr
    Dim olApp As Outlook.Application
    Dim objMail As Outlook.MailItem
    Dim olAttach As Outlook.Attachment
    Dim SecurityManager As New AddInExpress.OutlookSecurityManager
    Dim strEmail As String
    strSql = “SELECT ”
    strSql = strSql & “FNPR_CheckPrintSortTable.CheckPrintSortOrder,”
    strSql = strSql & “FNPR_CheckPrintSortTable.EmployeeNo,”
    strSql = strSql & “FNPR_CheckPrintSortTable.PeriodEndSortDate,”
    strSql = strSql & “FNPR_CheckPrintSortTable.CheckType,”
    strSql = strSql & “FNPR_EmployeeMasterTable.EarningsStatementPath,”
    strSql = strSql & “FNPR_EmployeeMasterTable.Email”
    strSql = strSql & ” FROM ”
    strSql = strSql & “FNPR_CheckPrintSortTable”
    strSql = strSql & ” INNER JOIN ”
    strSql = strSql & “FNPR_EmployeeMasterTable”
    strSql = strSql & ” ON ”
    strSql = strSql & “FNPR_CheckPrintSortTable.EmployeeNo = FNPR_EmployeeMasterTable.EmployeeNo”
    strSql = strSql & ” WHERE ”
    strSql = strSql & “(”
    strSql = strSql & “(FNPR_EmployeeMasterTable.Email Is Not Null)”
    strSql = strSql & ” AND ”
    strSql = strSql & “(FNPR_EmployeeMasterTable.EarningsStatementPath Is Not Null)”
    strSql = strSql & “)”
    strSql = strSql & ” ORDER BY ”
    strSql = strSql & “FNPR_CheckPrintSortTable.CheckPrintSortOrder”
    strSql = strSql & “;”
    If rstCheckSort.State adStateClosed Then
    rstCheckSort.Close
    End If
    DoCmd.Hourglass True
    rstCheckSort.Open strSql, CodeProject.Connection, adOpenForwardOnly, adLockReadOnly
    If rstCheckSort.BOF = True Then
    rstCheckSort.Close
    Set rstCheckSort = Nothing
    DoCmd.Hourglass False
    MsgBox “No email earnings statements found.”, vbCritical + vbOKOnly
    Exit Function
    End If
    strSubject = “Greetings from ” & strCompName
    strMessageText = “See attached payroll earnings statement for period ending ” & Format(txtPeriodEndingDate, “mm/dd/yyyy”) & “.”
    strMessageText = strMessageText & vbCrLf & vbCrLf
    Set olApp = Outlook.Application

    ‘ Fails on any SecurityManager call. Not just connect. SecurityManger.About fails as well.

    Call SecurityManager.ConnectTo(olApp)

    If SecurityManager.Check(osmObjectModel) osmOK Then
    MsgBox “Outlook security cannot be disabled.”, vbCritical + vbOKOnly
    GoTo EmailSendErr
    End If
    If SecurityManager.Check(osmObjectModel) = osmDLLNotLoaded Then
    MsgBox “Outlook Security cannot be disabled because Outlook Security Manager is not registered.”, vbCritical + vbOKOnly
    GoTo EmailSendErr
    End If
    If SecurityManager.Check(osmObjectModel) = osmSecurityGuardNotFound Then
    MsgBox “Outlook security guard cannot be found.”, vbCritical + vbOKOnly
    GoTo EmailSendErr
    End If
    If SecurityManager.Check(osmObjectModel) = osmUnknownOlVersion Then
    MsgBox “Outlook security cannot be disabled because Outlook Security Manager cannot determine Outllook version.”, vbCritical + vbOKOnly
    GoTo EmailSendErr
    End If
    SecurityManager.DisableOOMWarnings = True
    On Error GoTo EmailSendErr
    Do Until rstCheckSort.EOF = True
    Set objMail = olApp.CreateItem(olMailItem)
    strEmail = Trim(rstCheckSort(“Email”))
    strPathToFile = rstCheckSort(“EarningsStatementPath”)
    If Right(strPathToFile, 1) “\” Then
    strPathToFile = strPathToFile & “\”
    End If
    strOutputFile = strPathToFile & “EarningsStatement” ‘ Path to file
    strOutputFile = strOutputFile & “_” & rstCheckSort(“EmployeeNo”) ‘ Employee #
    strOutputFile = strOutputFile & “_” & rstCheckSort(“PeriodEndSortDate”) ‘ Period end date
    strOutputFile = strOutputFile & “_” & rstCheckSort(“CheckType”) ‘ Check type
    strOutputFile = strOutputFile & “.” & strOutputFileType ‘ File type
    Set olAttach = objMail.Attachments.Add(strOutputFile)
    objMail.BodyFormat = olFormatRichText
    objMail.Subject = strSubject
    objMail.Body = strMessageText
    objMail.To = strEmail
    objMail.Send
    DoEvents
    rstCheckSort.MoveNext
    Loop
    SecurityManager.DisableOOMWarnings = False
    Call SecurityManager.Disconnect(olApp)
    Set SecurityManager = Nothing
    Set olApp = Nothing
    Set objMail = Nothing
    Set olAttach = Nothing
    rstCheckSort.Close
    Set rstCheckSort = Nothing
    DoCmd.Hourglass False
    EmailStatements = True
    Exit Function
    EmailSendErr:
    SecurityManager.DisableOOMWarnings = False
    Call SecurityManager.Disconnect(olApp)
    Set SecurityManager = Nothing
    Set olApp = Nothing
    Set objMail = Nothing
    Set olAttach = Nothing
    rstCheckSort.Close
    Set rstCheckSort = Nothing
    DoCmd.Hourglass False
    MsgBox “Email aborted…correct error(s) and resend.”, vbCritical + vbOKOnly
    Exit Function
    EmailStatementsErr:
    gu_GenericError “EmailStatements”, Err, Error
    DoCmd.Hourglass False
    Set rstCheckSort = Nothing
    Exit Function
    End Function

  • Renat Tlebaldziyeu (Add-in Express Team) says:

    Hello Clive,

    Please try to register osmax.ocx and secman.dll manually from the following command lines:
    regsvr32 “path to the osmax.ocx”
    regsvr32 “path to the secman.dll”
    Did it help?

Post a comment

Have any questions? Ask us right now!