Consulting

Results 1 to 5 of 5

Thread: A VERY needed macro in Outlook 2003!! HELP

  1. #1

    A VERY needed macro in Outlook 2003!! HELP

    Tell me if you can make this for me since I 'm totally unfamiliar with Macro creation!
    This is what I need:

    I send an email to a Group List with a Subject "News" and an MP3 attachment called news.mp3, thats all I need to do automatically...
    So my actual steps while I do that are :

    1) New
    2) To:
    3) Select from the list _News Group 1
    4) Add the _News Group 1 to BCC
    5) Hit Ok
    6) Type News into the message Subject
    7) Attach the mp3 file by browsing and going to a folder (always the same folder) and dble clicking on it.
    8) Hit Send

    Thats all...
    Now I do that with 5 different attachments to 5 different recipient groups, but I imagine that if I have the code for the first one I can do the rest!

    Best Regards

  2. #2
    VBAX Regular slink9's Avatar
    Joined
    Jun 2004
    Location
    North Carolina
    Posts
    62
    Location
    Put the code below in a new module and then you can run it from the macros menu or create a toolbar button for it.

    Sub newmail()
    Set myolapp = CreateObject("Outlook.application")
    Set myitem = myolapp.CreateItem(olMailItem)
    myitem.Subject = "News"
    myitem.Body = "I have attached the news item"
    myitem.Recipients.Add ("_News")
    myitem.Attachments.Add ("c:\news\folder\news.mp3")
    myitem.Attachments.Add ("c:\news\folder\news2.mp3")
    myitem.Send
    End Sub

    That should do it. Notice that I included two attachments. You can include multiple attachments if you like.
    Stephen J. Link

    www.linkemup.us
    Need help on Outlook?
    Buy Link Em Up On Outlook
    Available at Amazon
    Listen in on ComputerAmerica radio
    My "appearance" is archived at my web site

  3. #3
    VBAX Master Killian's Avatar
    Joined
    Nov 2004
    Location
    London
    Posts
    1,132
    Location
    Hi there,
    If you enter file path as indicated below, this should send all the emails, ASSUMING:
    The 5 lists are named "_News Group 1", "_News Group 2", etc
    The 5 news file are named "news1.mp3", "news2.mp3", etc

    regards
    K :-)

    [VBA]
    Sub SendNews()

    Dim FILE_START As String
    Dim FILE_END As String
    Dim tempstring As String

    'type your mp3 path between the quotes including the first part of the file name e.g. c:\newsarchive\mp3s\news
    FILE_START = ""
    FILE_END = ".mp3"
    Set myOLApp = CreateObject("Outlook.application")
    For i = 1 To 5
    Set myItem = myOLApp.CreateItem(olMailItem)
    tempstring = "_News Group " & i
    Set myRecipient = myItem.Recipients.Add(tempstring)
    myRecipient.Type = olBCC
    With myItem
    .Subject = "News"
    .Attachments.Add (FILE_START & i & FILE_END)
    .Send
    End With
    Set myItem = Nothing
    Next
    Set myOLApp = Nothing

    End Sub
    [/VBA]

  4. #4
    VBAX Regular slink9's Avatar
    Joined
    Jun 2004
    Location
    North Carolina
    Posts
    62
    Location
    Ted,

    Did either of these help you?
    Stephen J. Link

    www.linkemup.us
    Need help on Outlook?
    Buy Link Em Up On Outlook
    Available at Amazon
    Listen in on ComputerAmerica radio
    My "appearance" is archived at my web site

  5. #5
    Site Admin
    The Princess
    VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    Last time Ted logged in was 10/25, so I don't think he's even seen them...
    ~Anne Troy

Posting Permissions

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