Results 1 to 4 of 4
  1. #1
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Outlook References (Word 97-->XP)

    Hi All

    I have created a form on a word document. On clicking a submit button the document is whizzed of by email to a recipient.

    I created this form a couple of years ago when we were just using Word 97 and Outlook 98. I have recently been asked to update this project another form and have realised that throughout my department I have Outlook 97,98,2000 and XP running on various PC's (Sorry satellite locations). I have written some code to work out what version of Outlook the user has loaded on their PC and depending on what it is the code either uses Outlook or Exchange. I have Outlook XP on my machine and works fine but if I go to a PC with ,say, Outlook 98 it produces an error stating it can't find the reference. Here is my question:

    If I design this doc/form so that it references the Outlook 98 references in the code, if it is run on a PC with Outlook XP or 2000 will the reference automatically update and get rid of the message?

    Jerry
    Jerry

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Outlook References (Word 97-->XP)

    In my experience, references update themselves automatically and correctly when moving from an older version to a newer version, but not the other way round. So if Outlook 97 ( <img src=/S/flee.gif border=0 alt=flee width=25 height=25>) is the oldest version you have to support, set a reference to the object library for that version. The code should work OK on later versions <img src=/S/crossfingers.gif border=0 alt=crossfingers width=17 height=16>

  3. #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: Outlook References (Word 97-->XP)

    You could switch to late binding. For example:

    Early (compile-time) binding:
    <UL>Dim olApp As Outlook.Application, msg As Outlook.MailItem
    Set olApp = New Outlook.Application
    Set msg = olApp.CreateItem(olMailItem)[/list]Late (run-time) binding:
    <UL>Dim olApp As Object, msg As Object
    Set olApp = CreateObject("Outlook.Application")
    Const olMailItem = 0
    Set msg = olApp.CreateItem(olMailItem)[/list]It's a bit of pain to convert over, and there is a performance penalty (amount unknown), but it would free you from having to worry about setting compile-time references...

  4. #4
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Outlook References (Word 97-->XP)

    Hi Hans

    As I suspected. While I was waiting for a reply I found myself rummaging through my draws and cupboards looking for an old laptop with Outlook 97 ( <img src=/S/blackhole.gif border=0 alt=blackhole width=15 height=15>) installed. This morning I changed the references and then went around and checked on PC's that had the different versions.....yes it does automatically convert up. Thank you

    Jerry
    Jerry

Posting Permissions

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