PDA

View Full Version : A VERY needed macro in Outlook 2003!! HELP



Ted Papas
10-21-2004, 03:04 PM
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

slink9
11-02-2004, 06:41 PM
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.

Killian
11-10-2004, 05:12 AM
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 :-)


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

slink9
11-10-2004, 11:28 AM
Ted,

Did either of these help you?

Anne Troy
11-11-2004, 12:47 AM
Last time Ted logged in was 10/25, so I don't think he's even seen them...