Outlook macros

nagu_flex

New Member
Joined
Jul 19, 2006
Messages
33
Hi Everybody!!

I need some macros for outlook.

Everyweek i have to send a mail to my clients around 250+ clients. Is there any way to genrate auto mail via macros.

I have list of mails in excel. Body of msgs are same.

If anybody suggest me to go shortcut via macro. They are highly appreceiated.

Thanks in advance.

Best Regds.
Nagu.
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Hi Nagu,

This method works in Excel, so I guess it works just as well in Access:

In the Visual Basic Editor set a reference to the Microsoft Outlook 10.0 Object Library (or the most upto date Outlook Library you have).
Rich (BB code):
Public Sub CreateEmail()

    Dim objApp  As Outlook.Application
    Dim objMail As MailItem
    
    On Error Resume Next
        Set objApp = GetObject(, "Outlook.Application")
    On Error GoTo 0
    
    If TypeName(objApp) = "Nothing" Then
        Set objApp = CreateObject("Outlook.Application")
    End If
    
    Set objMail = objApp.CreateItem(olMailItem)
    With objMail
        .To = "To email address"
        .CC = "CC email address"
        .Body = "This is the body of the text"
        'OR
        '.HTMLBody = "This is formatted body in bold"
        '.Attachments.Add "full path to attachment 1"
        '.Attachments.Add "full path to attachment 2"
        .Subject = "Subject heading"
        '.Save   'Save to draft folder
        '.Send   'Send email.
    End With
    
    Set objMail = Nothing
    Set objApp = Nothing

End Sub
I haven't tested the code, just taken out the bits I need from one of my procedures.

Edit: Hmmm, for some reason I thought I was in the Access forum... not general discussion. Not sure if this will work at all now :oops:
Obviously don't need to set a reference to Outlook if it's running in Outlook and Outlook doesn't use VBA, but VB Script.... ignore this post, it's rubbish.
 
Upvote 0
Thanks!

Hey guys,
I'm a novice at this stuff and found your posting. I looked up in outlook and saw how to add the outlook reference library and then used your code. It's awesome! I added some variables so that I can run down a list and send different files to lots of different people. Its really cool.
Later...
 
Upvote 0

Forum statistics

Threads
1,222,119
Messages
6,164,075
Members
451,870
Latest member
Nikhil excel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top