working with Outlook


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: working with Outlook

  1. #1
    Join Date
    Nov 2004
    Posts
    293

    Question working with Outlook

    I'm having a problem with my VB program that once worked ok but now doesent. Not a new story I'm sure. My program uses outlook to send an e-mail, and has been working up until our company CIS department made some upgrades to Outlook. Now I get the following error at the (olMailItem):

    Compile error:
    Can't find project or library.

    with my code looking like this:

    Dim sa As String, sb As String, sc As String
    Dim olApp As New Outlook.Application
    Dim NewMail As Outlook.MailItem
    Dim sMailAddress As String

    sMailAddress = GetEmailAddress 'use the function GetEmailAddress to take the supervisors name and convert to an address
    Set NewMail = olApp.CreateItem(olMailItem)
    NewMail.ClearConversationIndex
    NewMail.Recipients.Add sMailAddress
    ......

    I have two references checked in my project for Outlook, which are:
    Microsoft Outlook View Control
    Microsoft Outlook 10.0 Object library


    It seems to me that regardless of what upgrades are done to Outlook, the above code should work. Any Ideas what I can do ???

  2. #2
    Join Date
    Dec 2003
    Posts
    2,750
    Are there any libraries in the References dialog listed as missing?
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

  3. #3
    Join Date
    Nov 2004
    Posts
    293
    Yes, there are 4 of them all having to do with Crystal Reports. This I belive is because I created this program with CR-7 installed but just un-installed it and put in CR-10. So far my reports are running ok.

  4. #4
    Join Date
    Dec 2003
    Posts
    2,750
    Uncheck the missing references and try running your code again.
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

  5. #5
    Join Date
    Nov 2004
    Posts
    293
    That fixed it ! Wow I would have never suspected it would have been something like that because the things seemed so unrelated. Thats one to remember.

    Thank you
    Thank you
    Thank you !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center