Consulting

Results 1 to 4 of 4

Thread: Outlook Macro writing HELP PLEASE

  1. #1
    VBAX Newbie
    Joined
    Jul 2008
    Posts
    1
    Location

    Smile Outlook Macro writing HELP PLEASE

    Hi there my name is Joe and i need some guidance and help with writing a macro for our outlook for the company i work for. I work for a privately owned company where we send out multiple emails at the end of the week with multiple attachments but we dont send them all at once so as to keep from other subscribers from knowing who all of our companies subscribers are and their emails hidden for privacy reasons as well. Any help here to make our 3 hour job into a macro to do quite efficiently would be much appreciated thank you.

    -Joe

    Also I have no VBA knowledge yet so terminology and such wont help me lol...

  2. #2
    Knowledge Base Approver VBAX Master Oorang's Avatar
    Joined
    Jan 2007
    Posts
    1,135
    Location
    Erm, why don't you just bcc all the subscribers?
    Cordially,
    Aaron



    Keep Our Board Clean!
    • Please Mark your thread "Solved" if you get an acceptable response (under thread tools).
    • Enclose your code in VBA tags then it will be formatted as per the VBIDE to improve readability.

  3. #3
    BCC should be an easy and quick option unless you want to send customized mails to all subscribers. You can try mail merge too.

  4. #4
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    Create a list of your subscribers. Loop through each item of the list and create a personalised mail.

    Charlize
    [vba]Sub Send_Mailing()
    Dim DList As DistListItem, i As Long
    Dim MyMessage As Outlook.MailItem
    'Since outlook doesn't have the getopenfilename
    'we use the excelobject
    Dim oExcel As Object
    Dim vFile As String
    Set oExcel = CreateObject("Excel.Application")
    'LijstMailing is the name of your distributionlist with all
    'the contacts that you want to receive a mail
    Set DList = Application.Session.GetDefaultFolder(olFolderContacts). _
    Items("LijstMailing")
    vFile = oExcel.GetOpenFilename(MultiSelect:=False)
    For i = 1 To DList.MemberCount
    Set MyMessage = Application.CreateItem(olMailItem)
    With MyMessage
    .To = DList.GetMember(i).Address
    .Subject = "August Mailing"
    .Body = "Here some info regarding holidays in august."
    'In dutch version, when no attachment was selected
    'vFile becomes Onwaar, in english probably False
    '*** Have to take a look at this ... ***
    If vFile <> "Onwaar" Then
    .Attachments.Add vFile
    End If
    '.Display
    'If you don't want to display the message use .Send instead
    'of .Display
    .Send
    End With
    Next i
    'Clear the object
    Set oExcel = Nothing
    End Sub[/vba]And instead of just a fixed text for the messagebody you could use the properties of the contact (member(i)). If you want the name to say Hello x, use [VBA]DList.GetMember(i).Name[/VBA]to add the name to the body of your message.

Posting Permissions

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