• Send message w/ different versions of Outlook (Acc97 SR2)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Send message w/ different versions of Outlook (Acc97 SR2)

    Author
    Topic
    #382605

    I have a db that allows people to send emails when appropriate. Most everyone here uses A97 but there are a few that have Office2K and XP. I have installed A97 in an alternate directory on these machines and set the path of the shortcut to use the older version. No problems with that part. I use the SendMessage module (see attachment) to get around the different versions of Outlook. The problem I have is that when one of the users sends an e-mail (I think it is the XP machine), there is a reference added to the code for Outlook 10.0 and points to the Office directory for that machine. When someone else sends an e-mail, they get the missing reference message. Is there a better way around this? I already have 2 different submit buttons, one for Outlook and one for Outlook Express and I still have to explain the difference to the users.
    I saw another post that made reference to a 3rd party option. Any thoughts?

    I thought about copying the file that A97 uses to the same directory on all the other machines to try and “trick” Access and Outlook, but that seems a little far-fetched.

    Viewing 2 reply threads
    Author
    Replies
    • #649390

      This issues was discussed in WAW of Dec 18. the following workaround was suggested;

      All you have to do is uncheck the references to the Office 10 object libraries, and replace them with
      references to the Office 9 object libraries, while the Access 2000 database is open in Access 2002.  
      Once you have set a reference to Word 9.0, Outlook 9.0, or whatever other Office component you need in
      Access 2002, you can alternately open the database in Access 2000 and Access 2002, without reference errors.
      

      I imagine you could set the references back to the relevant 97 references instead.

    • #649432

      Is this database perchance on a shared folder instead of local to each machine? That might cause you some grief because if you set the references for one machine that runs it, it will be broken for another. That’s one of the reasons shared front ends are not recommended. Another issue is how Outlook was installed on the several machines. If it was installed to run IMO, then you may run into problems trying to automate it like that. Make sure Outlook is installed consistently (even if the versions are different) on the machines involved, and be especially careful of Office 2000 and Office XP machines, where the CDO library is not installed by default, even though Outlook is installed.

    • #649516

      I have looked at your code and think this may help you. If you use late binding then you do not need a reference to the Outlook Object Library in your Access application. I think this method will solve your problem.

      Replace your Dim-statements defining the Outlook objects by the lines of code shown below:

      ‘****** start of code
      ‘ When you set Development = True you need to add a reference to
      ‘ the MS Outlook xx.x Object Library.
      ‘ When you set Development = False you don’t need the reference.
      #Const Development = False
      #If Development = True Then
      ‘ Define Outlook objects
      Dim objOutlook As Outlook.Application
      Dim objOutlookMsg As Outlook.MailItem
      Dim objOutlookRecip As Outlook.Recipient
      Dim objOutlookAttach As Outlook.Attachment
      #Else
      ‘ Define Outlook constants
      Const olTo = 1
      Const olCC = 2
      Const olBCC = 3
      Const olMailItem = 0
      ‘ Define Outlook objects
      Dim objOutlook As Object
      Dim objOutlookMsg As Object
      Dim objOutlookRecip As Object
      Dim objOutlookAttach As Object
      #End If
      ‘ ****** end of code

      While developing you should set the conditional compilation constant Development = True.
      This will allow you to use Outlook Object Library defined constants (olConstants) without getting compilation errors.
      Once your code works, you can remove the reference to the Outlook Object Library and set Development = False.
      At this point if you get compilation errors because you have added olConstants you will have to define them the way I have done above.
      You can find their value by temporarily setting a reference to the Outlook Object Library again and then use the Object Browser to search for them. Click the constant and you will see its value in the bottom part of the Object Browser display.
      If you have not tried to use the Object Browser before – it’s time to get started. You will love it. Just press F2 from the module editor and you are ready.

      Hope it helps.

      • #649589

        Hi all and thanks for the replies.
        First of all, for John:
        I don’t know what a WAW is. Is that some public reference or just a newsletter that comes complete with a secret handshake, or what? I’m actually not using the higher versions of Access to open the db. I’m using A97 to open it on all machines. The problem is that they have the different versions of Outlook. I did, however, un-check the references and it seems OK, but I don’t think that the XP user has had to use it since (it’s been about a week).

        For Charlotte:
        Yes, this is in fact on a shared folder. I had considered making different front ends, but there are a couple of issues with that. One, I didn’t want to have to update it 3 times every time something changed. Two, there is a coded autonumber-type field that issues a calculated number (it’s a PO request db). So it looks at the highest number in the number part of the field and adds one to it. I don’t know how to fix it so that more than one person can use it at a time. Therefore, I have a batch file that checks to see if there is a corresponding ldb file, and either returns a message saying that the db is unavailable, or opens it. If I split the db, it seems like it would be harder to pull that off.
        IMO is another acronym I’m not familiar with. How does Outlook run “IMO”?

        For Claus:
        What are the # signs for? I’ve never seen that before. I’ll have a closer look at your code sample and see if I understand it well enough to give it a try. I can see right off that I don’t know what you’re talking about by setting Development=True or False. I do appreciate the code sample just the same as well as the tip about the object browser. I’ll have to play with that and see what I can find.

        • #649595

          In response to the first question, WAW is Woody’s Access Watch which you can get to via http://woodyswatch.com/access/%5B/url%5D. It is a newsletter about Access written (mostly) by Helen Feddema, and you can subscribe to it on the hope page of wopr.com.

        • #649657

          I am sorry if I have confused you, Chico. To get right to the point: what I guess you need right now is this part of my code to avoid a reference to the Outlook Object Library:

          ‘ Define Outlook constants
          Const olTo = 1
          Const olCC = 2
          Const olBCC = 3
          Const olMailItem = 0
          ‘ Define Outlook objects
          Dim objOutlook As Object
          Dim objOutlookMsg As Object
          Dim objOutlookRecip As Object
          Dim objOutlookAttach As Object

          as a replacement for your DIM objOutLook

        • #649682

          IMO is Internet Mail Only, one option in installing Outlook. The other configuration is CWG or Corporate/Workgroup.

          • #650085

            Charlotte,
            The IMO is coming back to me now. I guess you could say that all our machines run IMO, since we only use Internet mail.

            Claus,
            I’ll take another look at your code sample as time permits.

            Thanks Again

            • #650219

              That could be part of your problem. If I remember correctly, installing Outlook IMO doesn’t install the CDO library.

    Viewing 2 reply threads
    Reply To: Send message w/ different versions of Outlook (Acc97 SR2)

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

    Your information: