locked
Why aren't the Mapi.Session object or the Redemption.RDOSession not loading? RRS feed

  • Question

  • I've been on this problem for two weeks now and I can't seem to find an answer.  I initially created an add-in for outlook 2003 in VS2005 that allows email to be attached into our CRM application.  Everything seemed to be going well.  Then recently, we installed the application onto a newly imaged machine.  The add in would load, but on the button click, the application would not get to the end of the sub.  Here is the underlying code on the click event that I am using to test.  I substituted the RDO session in the appropriate place to see if that would work as well.

     

           MessageBox.Show("Button clicked")

           Dim EmailMapiSession As MAPI.Session

           EmailMapiSession = New MAPI.Session

           EmailMapiSession.Logon(NewSession:=False)

           MessageBox.Show("Mapi Created")

     

    I see the first messagebox, but that is all.  I have set VSTO_SUPPRESSDISPLAYALERTS = 0 and VSTO_LOGALERTS=1.  Neither show any problems.  I attempted to use fusion to see if there was anything abnormal, no luck.  I even tried re-installing MS Office and the latest CDO, 1.21.  I have set the security using caspol for all the components and added the approriate assemblies to the GAC.  On a last ditch effort, I tried installing the 2003 PIA's to no joy.  

    On a side note it works on the "older" image, but not the new one.  Unfortunately, we lost the older image in a server crash. I am at my wit's end and tried everything I could find.  Can anyone help me?

    Edit:  I just remembered that if I install VS2005 onto the target machine, the add-in does eventually work.
    Monday, November 7, 2011 9:05 PM

Answers

  • Send me an e-mail to dmitry at dimastr dot com and I will send you a debug version of Redemption that logs very MAPI call it makes.
    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.2 is now available!

    Monday, November 7, 2011 9:33 PM

All replies

  • Send me an e-mail to dmitry at dimastr dot com and I will send you a debug version of Redemption that logs very MAPI call it makes.
    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.2 is now available!

    Monday, November 7, 2011 9:33 PM
  • Thank you Dmitry.  
    Monday, November 7, 2011 11:34 PM
  • Here is the Redemption Version

     

     

    'Imports MAPI

    public class ThisApplication

     

        Dim StringToDisp As String = "Hello World"

        Private WithEvents CmsCase_Button As Office.CommandBarButton

        Private WithEvents MyCmdBar As Office.CommandBar

        Private WithEvents OLExplorer As Outlook.Explorer

     

        Private Sub ThisApplication_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup

            OLExplorer = Me.ActiveExplorer

            MyCmdBar = OLExplorer.CommandBars.Add(Name:="Cms Command Bar", Temporary:=True)

     

            MyCmdBar.Visible = True

            MyCmdBar.Position = Microsoft.Office.Core.MsoBarPosition.msoBarTop

     

            CmsCase_Button = MyCmdBar.Controls.Add(Office.MsoControlType.msoControlButton, Temporary:=True)

            CmsCase_Button.Caption = "Cms &Case"

            CmsCase_Button.Style = Microsoft.Office.Core.MsoButtonStyle.msoButtonCaption

            CmsCase_Button.BeginGroup = True

     

     

        End Sub

     

        Private Sub ThisApplication_Shutdown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown

     

        End Sub

     

        Private Sub CmsCase_Button_Click(ByVal Ctrl As Microsoft.Office.Core.CommandBarButton, ByRef CancelDefault As Boolean) Handles CmsCase_Button.Click

            MessageBox.Show("Button clicked")

            Dim EmailMapiSession As Redemption.RDOSession

            EmailMapiSession = New Redemption.RDOSession

            EmailMapiSession.Logon(NewSession:=False)

            MessageBox.Show("Mapi Created")

        End Sub

    End Class

     

    I never get the "Mapi Created" message
    Tuesday, November 8, 2011 3:43 PM