+ Reply to Thread
Results 1 to 3 of 3

Outlook Email Reference

  1. #1
    sbruner
    Guest

    Outlook Email Reference

    I am launching an inter-company spreadsheet that sends an email in a macro.
    I am using Outlook version 11, but many others have outlook version 9.
    Whenever a person using version 9 clicks the button that sends the email from
    excel, it gives a reference error showing that reference library for Outlook
    11 is missing. How can I include some code that will allow both Outlook v.9
    and Outlook v.11 users to use the form without an error? Here is my current
    code line for the outlook reference.

    Dim OutApp As Outlook.Application
    Dim OutMail As Outlook.MailItem
    Dim strdate As String
    Dim wb As Workbook
    Dim ws As Worksheet
    Application.ScreenUpdating = False
    Set OutApp = CreateObject("Outlook.Application")



    Any Help is greatly appreciated.

  2. #2
    Ron de Bruin
    Guest

    Re: Outlook Email Reference

    Hi sbruner

    In every Outlook example on my site there is a example for Late Binding
    http://www.rondebruin.nl/sendmail.htm


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "sbruner" <sbruner@discussions.microsoft.com> wrote in message news:EBB098E7-162E-4A0D-AC02-E689DE7E7E0C@microsoft.com...
    >I am launching an inter-company spreadsheet that sends an email in a macro.
    > I am using Outlook version 11, but many others have outlook version 9.
    > Whenever a person using version 9 clicks the button that sends the email from
    > excel, it gives a reference error showing that reference library for Outlook
    > 11 is missing. How can I include some code that will allow both Outlook v.9
    > and Outlook v.11 users to use the form without an error? Here is my current
    > code line for the outlook reference.
    >
    > Dim OutApp As Outlook.Application
    > Dim OutMail As Outlook.MailItem
    > Dim strdate As String
    > Dim wb As Workbook
    > Dim ws As Worksheet
    > Application.ScreenUpdating = False
    > Set OutApp = CreateObject("Outlook.Application")
    >
    >
    >
    > Any Help is greatly appreciated.




  3. #3
    keepITcool
    Guest

    Re: Outlook Email Reference



    note:
    your code must compile without the outlook library:
    Just using CreateObject does not constitute late binding..
    (although you need it)

    All variables must be defined as generic object variables.

    Dim outApp as object 'generic vba object
    Dim outApp as object

    All constants which would be provided by the outlook library
    must be defined inside your project or replaced with numeric value in
    the code..

    for code to work with ol9 and ol11 you must check
    that you ONLY use methods/functions/procedures that exist
    in both versions.

    for normal development you'd need a machine with ol9.
    Create the code WITH the library. Ensure it works in ol9.
    Then edit code to latebound and remove the referenced library.
    then test it can compile.



    --
    keepITcool
    | www.XLsupport.com | keepITcool chello nl | amsterdam


    Ron de Bruin wrote :

    > > Dim OutApp As Outlook.Application
    > > Dim OutMail As Outlook.MailItem
    > > Dim strdate As String
    > > Dim wb As Workbook
    > > Dim ws As Worksheet
    > > Application.ScreenUpdating = False
    > > Set OutApp = CreateObject("Outlook.Application")


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1