Consulting

Results 1 to 2 of 2

Thread: Help Send an Email to Outlook Group in VBA

  1. #1

    Help Send an Email to Outlook Group in VBA

    Hi i am wondering if someone could help me

    I am currently working on a VBA application, the main thing it does in when a document is opened, a button is click and the macro will run; what happens is it that the name of the doc i have opened (WordFN), searches this in excel, once found offsets to the right take this value (ExcelFN) and opens it as a word document.

    What i want to do is when is for the macro to send an email to a group in Outlook.

    Is this possible to do?

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    Try this:

    [VBA]
    Option Explicit

    Sub eMail()

    Dim OL As Object
    Dim EmailItem As Object
    Dim Doc As Document

    Application.ScreenUpdating = False

    Set OL = CreateObject("Outlook.Application")
    Set EmailItem = OL.CreateItem(olMailItem)
    Set Doc = ActiveDocument

    With EmailItem
    .Subject = "Insert Subject Here"
    .Body = "Insert message here" & vbCrLf & _
    "Line 2" & vbCrLf & _
    "Line 3"
    .To = "User@Domain.Com"
    .Display
    End With

    Application.ScreenUpdating = True

    Set Doc = Nothing
    Set OL = Nothing
    Set EmailItem = Nothing

    End Sub
    [/VBA]

Posting Permissions

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