PDA

View Full Version : Outlook Macro writing HELP PLEASE



GIJOEYHI
07-18-2008, 03:19 PM
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...

Oorang
07-22-2008, 09:16 AM
Erm, why don't you just bcc all the subscribers?

safwanjamil
08-01-2008, 01:05 AM
BCC should be an easy and quick option unless you want to send customized mails to all subscribers. You can try mail merge too.

Charlize
08-01-2008, 01:35 AM
Create a list of your subscribers. Loop through each item of the list and create a personalised mail.

Charlize
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 SubAnd 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 DList.GetMember(i).Nameto add the name to the body of your message.