• Automation Error

    • This topic has 6 replies, 3 voices, and was last updated 24 years ago.
    Author
    Topic
    #355513

    Hello folks
    Can somebody point in the direction of the correct question to ask and a source …

    I have a routine working fine on Word 97 SR1 running on Win2k desktop & Win2k Server. Among the libraries referenced are

    stdOle2.tlb

    When the same routine is transferred to Office 2000 running on Win 98 & NT4 its Crash & Burn time

    Automation Error 492

    Extracts from the routine below working on W2k & Office 97
    ———————————-
    Dim objSession As Object
    Dim myItem As Object
    Dim objmsg As Object
    Dim objRecipient As Object

    blah blah

    Set objSession = CreateObject(“Mapi.session”)
    objSession.logon newSession:=False
    Set objmsg = objSession.outbox.messages.Add
    objmsg.Subject = strSubject
    objmsg.Text = strPriority & Chr(13) & strMessage
    Set objRecipient = objmsg.Recipients.Add

    objRecipient.Name = strRecipient
    objRecipient.resolve
    objmsg.send showdialog:=False

    objSession.logoff

    etc remainder of processing

    ————-
    My questions
    1 Are different libraries required
    2 Where / how do I ascertain which libraries are required for varying platforms
    3 Are there differences in creating Mapi sessions between the platforms
    4 What havent I considered >

    Cheers
    Geof

    Viewing 1 reply thread
    Author
    Replies
    • #524534

      You’re going to have to tell us where the error occurs. I reference that library in some of my converted Access apps without problems on Windows NT. If I take your code and run it in an Access 2000 database, it works fine against Outlook 2000.

    • #524566

      I think the MAPI object is in the Microsoft CDO xxx Library. Does the target system have CDO.DLL installed and registered? I have Win98/Office 2000 Developer and it lies along this path:

      c:Program FilesCommon FilesSystemMAPI103395CDO.DLL

      (Bonus: I just noticed that the ScanPST utility lives in the same place.)

      • #524567

        Hi Jefferson
        Thank you for that. I will give it a try.
        However that CDO.DLL is not listed on the system that is working.
        This is a learning experience ..
        Geof

        • #524571

          Edited by jscher2000 on 01/04/29 21:32.

          Well, it is indeed. I don’t know enough about Office automation, but I’m going to make some guesses and assumptions. When you issue this command:

          Set objVar = CreateObject(“MAPI.Session”)

          I’m guessing that VBA looks into the only central repository of object definitions on the computer, the registry.

          In my registry, I have this key:

          HKEY_CLASSES_ROOTMAPI.SessionCLSID

          which returns the number:

          {3FA7DEB3-6438-101B-ACC1-00AA00423326}

          Which is itself a key with this subkey:

          HKEY_CLASSES_ROOTCLSID{3FA7DEB3-6438-101B-ACC1-00AA00423326}InprocServer32

          Which points to this executable:

          c:Program FilesCommon FilesSystemMapi103395CDO.DLL

          And so we come full circle. Where does yours point?

          New – try the attached routine to plumb your registry more easily. It requires the Word System object. This has only been tested on Windows 98.

      • #524568

        The CDO.dll is part of Microsoft Exchange and it will be in different locations depending on the operating system. You don’t need to set a reference to it to issue MAPI calls.

        • #524569

          Very interesting. We don’t use Exchange, but I did reconfigure mail support to Corporate Workgroup for other reasons. Perhaps that installed it.

    Viewing 1 reply thread
    Reply To: Automation Error

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: