send email to the distribution list in outlook 2003 contacts

Discussion in 'Visual Basic ( VB )' started by bulleye, Oct 12, 2006.

Thread Status:
Not open for further replies.
  1. bulleye

    bulleye New Member

    Joined:
    Oct 12, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Hi everyone,
    i am new here and my first post. i'd like to send email from excel using vbcript. how i code it so that the email are sent to the distribution list in my outlook 2003 contacts. below is the codes for sending mail to indivual email addresses. Any help would be appriciated:
    Code:
    Sub Senmail()
    Dim objOutlook As Object
    Dim objOutlookMsg As Object
    Set objOutlook = CreateObject("Outlook.Application")
    Set objOutlookMsg = objOutlook.CreateItem(0)
    With objOutlookMsg
    .To = "name@email.com"
    .Cc = "name@email.com"
    .Subject = "Hello World (one more time)..."
    .Body = "This is the body of message"
    .HTMLBody = "HTML version of message"
    .Attachments.Add ("f:\Test.txt")
    .Send 'Let´s go!
    End With
    Set objOutlookMsg = Nothing
    Set objOutlook = Nothing
    End Sub
    Thanks
    Bulleye
     
    Last edited by a moderator: Oct 13, 2006
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice