locked
Visual Basic 08 application to send e-mail - trouble making it use both Office 2010 and 2007 RRS feed

  • Question

  • Hi

     

    I have written an application which uses the Outlook object library to send an e-mail with information from a textbox. I programmed this on Windows 7 and Office 2010, which was a mistake as most of the clients will be using Windows XP and Office 2007. I am getting an error when running the application on Windows XP/2007:

     

    Could not load file or assembly 'Microsoft.Office.Intero.Outlook, Version=14.0.0.0 .... etc

    I understand that this is because I have not loaded the Outlook 12.0 assemblies, however I am having trouble adding the assemblies on my Win7/2010 programming machine. I have downloaded the standalone Office 2007 PIAs however the Outlook 12.0 doesnt appear on the list, and when I try and add just the Office 12.0 I get an error.

     

    is there a way to standardise and make the application work with both 2007 and 2010 outlook machines? I think it is possible, I have read some articles making the application choose the correct version, however cannot figure out how to.

     

    Any help would be much appreciated. Thanks

    Tuesday, December 14, 2010 3:59 PM

Answers

  • Hi Paul

     

    Thanks for the reply - so if I add that object library, it will work for both 2007 and 2010?

     

    I have tried adding that one, however it doesnt seem to appear in the list. I have downloaded and installed the 2007 PIAs, but it isnt on the list, I only have Microsoft Office 12.0 Object Library, not the Outlook specific one - any clues?

     

    Thanks for your help

    Theoretically it should work. I've never added the "Microsoft Office" library but the Core interop may be added automatically to the project when adding one of Office application specific components.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Marked as answer by Jie Bao Monday, December 27, 2010 1:49 AM
    Tuesday, December 14, 2010 9:47 PM
  • You should be coding to the minimum version supported by the application. If it's Office 2007 then you should be using the version 12.0 PIA (Project...Add Reference...COM tab...Microsoft Outlook 12.0 Object Library).
    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Marked as answer by Jie Bao Monday, December 27, 2010 1:49 AM
    Tuesday, December 14, 2010 4:59 PM

All replies

  • You should be coding to the minimum version supported by the application. If it's Office 2007 then you should be using the version 12.0 PIA (Project...Add Reference...COM tab...Microsoft Outlook 12.0 Object Library).
    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Marked as answer by Jie Bao Monday, December 27, 2010 1:49 AM
    Tuesday, December 14, 2010 4:59 PM
  • Hi Paul

     

    Thanks for the reply - so if I add that object library, it will work for both 2007 and 2010?

     

    I have tried adding that one, however it doesnt seem to appear in the list. I have downloaded and installed the 2007 PIAs, but it isnt on the list, I only have Microsoft Office 12.0 Object Library, not the Outlook specific one - any clues?

     

    Thanks for your help

    Tuesday, December 14, 2010 8:29 PM
  • Hi Paul

     

    Thanks for the reply - so if I add that object library, it will work for both 2007 and 2010?

     

    I have tried adding that one, however it doesnt seem to appear in the list. I have downloaded and installed the 2007 PIAs, but it isnt on the list, I only have Microsoft Office 12.0 Object Library, not the Outlook specific one - any clues?

     

    Thanks for your help

    Why don't you simply try?

     


    Success
    Cor
    Tuesday, December 14, 2010 9:30 PM
  • Hi Paul

     

    Thanks for the reply - so if I add that object library, it will work for both 2007 and 2010?

     

    I have tried adding that one, however it doesnt seem to appear in the list. I have downloaded and installed the 2007 PIAs, but it isnt on the list, I only have Microsoft Office 12.0 Object Library, not the Outlook specific one - any clues?

     

    Thanks for your help

    Theoretically it should work. I've never added the "Microsoft Office" library but the Core interop may be added automatically to the project when adding one of Office application specific components.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Marked as answer by Jie Bao Monday, December 27, 2010 1:49 AM
    Tuesday, December 14, 2010 9:47 PM