Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Oct 2003
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access/Outlook (2000)

    Integrating Access with Outlook. I'm trying to insert names into the To: field and the CC: field. I can get the To: field to work no problem. The issue is with inserting the names into the CC: field. Below is an excerpt of the code...everything is declared just didn't include that here.

    Set myOlApp = CreateObject("Outlook.Application")
    Set myItem = myOlApp.CreateItem(olMailItem)
    Set myRecipient = myItem.Recipients.Add ("Bill.Johnson@company.com")
    myRecipient.Type = olCC

    Any help with with this would be appreciated.

    Thanks!

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Access/Outlook (2000)

    That code works for me - do you have a reference set to the Outlook object library? (if not, you can't use constants like olCC)
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    Star Lounger
    Join Date
    Oct 2003
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access/Outlook (2000)

    Sometimes its the simplest things that get overlooked.

    Thanks.

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

    Re: Access/Outlook (2000)

    You can omit the reference to the Outlook object libary if you replace the olSomething constants with their values - you can look these up in Outlook VBA. In your code, olMailItem can be replaced with 0 and olCC with 2. If you do this, you should also change all declarations of variables As Outlook.Something with As Object. This is called late binding; this can be useful if users have installed Outlook in a non-standard location, for example.

Posting Permissions

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