Results 1 to 7 of 7
  • Thread Tools
  1. 3 Star Lounger
    Join Date
    Apr 2001
    Location
    Levin, Manawatu-Wanganui, New Zealand
    Posts
    240
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Automation Error

    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

  2. Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Automation Error

    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.
    Charlotte

  3. Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Automation Error

    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.)

  4. 3 Star Lounger
    Join Date
    Apr 2001
    Location
    Levin, Manawatu-Wanganui, New Zealand
    Posts
    240
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Automation Error

    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

  5. Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Automation Error

    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.
    Charlotte

  6. Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Automation Error

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

  7. Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Automation Error

    <P ID="edit"><FONT SIZE=-1>Edited by jscher2000 on 01/04/29 21:32.</FONT></P>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.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •