Close Window   
Free Ebook
Get Your Free Excel
ebook!
Our Top 15 Excel Tutorials
Instant Access!
E-mail:
Subscribe for Free Excel tips & more!
E-mail:
Advertisements



Outlook Voting Button

Forum Register
Search Excel Forum Posts, Tutorials, Macros, Tips, and More

To whom it may concern,

How do I include "Voting Buttons" in an Outlook email message using a macro
from Excel 2003? I have tried adding them as objects within the email
portion of the macro code, but have not been successful. Any help would be
greatly appreciated.


TIA
Andrew Sbrana
Senior Business Analyst




View Answers     

Similar Excel Tutorials

What is a Macro in Excel?
This is the first step to learning about Macros for Excel and how to use them. What is a Macro?   A macro is a smal ...
Run a Macro When you Click a Button in Excel
Make a macro run when you click a button in the worksheet in Excel. This allows you to create a button and put it a ...
Make Professional Looking Rounded Buttons in Excel
How to make professional looking rounded buttons in Excel. This allows you to avoid using basic buttons and also to ...
Enable the Analysis ToolPak in Excel
How to enable the Analysis ToolPak in Excel. This is an add-in program that comes with Excel and allows you to use ...
How to Enter Data into Excel
Entering data into Excel is exactly the same across all Excel versions and can be done in a number of different way ...
Install Solver Add-In for Excel
How to Install the Solver Add-In into Excel. Sections: Install Solver Developer Tab Add-In Install Install Solver G ...

Helpful Excel Macros

Email Current Workbook & or Other Attachments
- This macro will send the current workbook in an email through Microsoft Outlook. The Macro allows you to send the most
Send Emails through Outlook using Email Addresses from Excel and text from Word
- This macro allows you to send an email to a list of recipients through excel. The email will be sent through Outlook an
Open Microsoft Outlook from Excel
- This free macro will open the Microsoft Outlook program on your computer. You do need to have this program first. This
Macro to add a New Line to Message Box Pop-up Windows in Excel
- This is a very simple Message Box, pop-up window, macro for Excel that illustrates how to put new lines, the same thi
Display The Actual Link / Email Address From Links in Excel - UDF
- Display the actual link or email address from links within Excel with this UDF. This user defined function pulls the ac

Similar Topics







Hi All,

I've got the below code that sends an E-mail from outlook via VBA coding in a macro, I would like someone to help me add into the code the following;

Custom Voting Buttons: Approve; Reject; Hold ECS
Redirect replies to another E-mail address.

VB:

Dim Email_Subject, Email_Send_To, Email_Cc, Email_Bcc, Email_Body As String 
Dim Mail_Object, Mail_Single As Variant 
 
Email_Subject = "Automatic Message: Re-sale Register" 
Email_Send_To = "[EMAIL="TestEmail@Test.co.uk"]TestEmail@Test.co.uk[/EMAIL]" 
Email_Bcc = "[EMAIL="AnotherEmail@Test.co.uk"]AnotherEmail@Test.co.uk[/EMAIL]" 
Email_Body = "New comments have been added to a part you've subscribed to" 
On Error Goto debugs 
Set Mail_Object = CreateObject("Outlook.Application") 
Set Mail_Single = Mail_Object.CreateItem(0) 
With Mail_Single 
    .Subject = Email_Subject 
    .To = Email_Send_To 
    .BCC = Email_Bcc 
    .Body = Email_Body 
    .send 
End With 
debugs: 
If Err.Description <> "" Then MsgBox Err.Description 


If you like these VB formatting tags please consider sponsoring me in support of injured Royal Marines



I know the following question is not to do with Excel but it's related and I need to re-think how to do the above if this isn't possible:
Is it possible to have an E-mail address in outlook look at all incoming E-mails and change a spreadsheet depending on what the E-mail says?

I know theres a few complex questions, feel free to ask more.

Thanks,
Ranmaru2

I have created a macro which sends an email out with voting buttons Approve and Reject.
Problem is, when the receiver of the email hits Approve, it only gets send to the sender of the origin email (user of the program). I wanted it set up so that when the receiver hits Approve,it gets sent to the user of the program as well as me. I tried putting both names in the TO field but the response only gets sent to the user of my application that sent the email out. Is there any way to get around this?


I have a macro that sends a worksheet via email [Outlook] to a list of recipients. Everytime an email is created, outlook pops up a confirmation window and waits for user input "yes".


Can I set up vba or outlook to skip that step?

I really want to create a macro with a loop to go through a list of files, execute a macro in each one, save the files and send emails to various people. This process will create about 40 emails and I don'd want the admin person to have to sit there and confirm each message going out.

Any help would be apprecited.
modytrane


Hi Guys,

I have a spreadsheet with a number of different actions with various different dates associated to them. Is it possible to create a macro that will automatically send an email to my outlook inbox (or somebody elses) when the date is due or upcoming?

Also is it possible to include different content in the email based on say the title of the action etc?

Any help would be greatly appreciated, thanks in advance


The first two parts of this macro work just fine, it's the closing part of it which doesn't work. The strange thing is, if I isolate the close part of the macro and run it as it's own macro, it will work. However, it will not work as part of a larger macro, or even if called from a higher macro which contained the open portion. Here is my code:

Code:

Sub launch_send_close_outlook()

'launch Outlook
Dim Outlook As Outlook.Application
Set Outlook = CreateObject("Outlook.Application")
Dim ns As Outlook.Namespace
Dim Folder As Outlook.MAPIFolder
Set ns = Outlook.GetNamespace("MAPI")
Set Folder = ns.GetDefaultFolder(olFolderInbox)
Outlook.Explorers.Add Folder
    
    'send email
    Set myOlApp = CreateObject("Outlook.Application")
    Set mailItem = myOlApp.CreateItem(olMailItem)
    Set myRecipient = mailItem.Recipients.Add("name@domain.com")
    mailItem.body = "testing"
    mailItem.Subject = "test email"
    mailItem.Send

'close Outlook
Set Outlook = CreateObject("Outlook.Application")
Outlook.Quit
Set Outlook = Nothing

End Sub


If anyone can explain what I'm doing wrong with the last part, I would appreciate it. Also, if any other part of my code could use some cleaning up, feel free to let me know.

Thanks!


Hi guys.

I am trying to create a simple Macro in Outlook (2002) which will send a reply back to the original email recipient with specific text in the subject and body. (I know I could probably do this using Rules but I need to be able to manually choose who to send this reply to.)

I found some VBA and tailored it to suit but when I click on the menu button that I linked to this Macro, I get a prompt saying, "A program is trying to automatically send e-mail on your behalf..." and you need to click YES to send it. If you click NO, you get a debug error.

Is there something in the code (copied below) that I can add/amend to stop this prompt from appearing? (I thought this message only appeared if you use VBA from another program, not when entering VBA directly into Outlook.)

Also, when I click on the Macro button, it opens up the auto-reply in a new window so that I'm still left with the original email open. Is there a line of code I can enter that will close this email too? I would appreciate your help.

Sub EmailReply()
Dim Reply As Outlook.MailItem
Dim Original As Outlook.MailItem
Set Original = Application.ActiveExplorer.Selection(1)
Set Reply = Original.Reply
Reply.Attachments.Add Original
Reply.Subject = "Important Notice"
Reply.Body = "Body text to be entered here"
Reply.Display
Reply.Send
End Sub

Thanks.

Richard


Dear Gurus,

Can some one give me macro which creates logs of outlook in excel.

(Sorry if some one already had asked this question. please forward me link if its already solved post.)

I want to create a button with function of this macro. So that, when I select any email ( from inbox or sent items) and by clicking macro button, it should create logs of selected email in one excel workbook.

Logs should be of:
1. Date of email (sent/received)
2.Type of Email (sent or received)
3 Email Id (of sender/reveiver)
4. Subject
5. Hyperlink to open that email (from excel)


Thanks in advance.




Hi all,

hopefully someone can point me in the right direction! How do you include a variable in the HTML body for an email generated via macro? I have the current selection of cells stored in a variable SelRange, my code looks like:



Please Login or Register  to view this content.


I've tried a few combinations but I only dabble with VBA so im not sure where Im going with this problem.

Second request, does anyone know how to include the outlook default signature to the email when using HTML body? This seems to delete it as apposed to using plain text email.

Thanks in advance!

Hello,

I have an excel macro that creates a CSV file and sends the file to a server for processing. Once the processing is complete, the server sends an email to the user to let them know the processing is done. What I would like to do is create a VBA Macro that triggers an event in Microsoft Outlook each time outlook receives a new email. From the reading I've done, this is possible, but I can't get it to work.

Here is the code that I've put into the VBA Editor in MS Outlook:

Code:

Private Sub Application_NewMail()
    MsgBox "hello world"
End Sub


If I can get this event to fire, then I think I can figure out how to look at the new mail message and get the information I need. I just can't figure out how to get a new message to trigger this procedure.

I've changed the security settings so macros should run and I'm using Outlook 2007.

Thanks In Advance.


Hi All,

iam just trying to write a macro which will automatically send email depending on one's birthday.

iam able to send the email but iam stucked at calcualtions of days could someone please help me.

iam attaching an S/S

Code:

Sub shekartestmail()
    Dim ol As Object, myItem As Object
  
    Set ol = CreateObject("outlook.application")
    For Each AddCell In Worksheets("Sheet1").Range("B2:B100")
    Set myItem = ol.CreateItem(olMailItem)
        myItem.To = AddCell.Value
        myItem.Subject = "Hello There..."
        myItem.Body = "Hello, " & AddCell.Offset(0, 1).Value & "." & Chr(13) & Chr(13)
        myItem.Body = myItem.Body & "Many Happy returns of the day." & Chr(13)
        myItem.Body = myItem.Body & "Thanks for all your Support." & Chr(13) & Chr(13)
        myItem.Body = myItem.Body & "Shekar Thonta," & Chr(13)
        myItem.Body = myItem.Body & "Senior Analyst HR," & Chr(13)
        myItem.Body = myItem.Body & "India Service Centre" & Chr(13)
        myItem.Body = myItem.Body & "ManiKonda,Gachibowli" & Chr(13)
        myItem.Body = myItem.Body & "Hyderabad-500001" & Chr(13)
        myItem.Body = myItem.Body & "Internal Message" & Chr(13)
                SendIt = MsgBox("Here's the message to " & myItem.To & Chr(13) & Chr(13) & myItem.Body, vbOKCancel)

        If SendIt = vbOK Then
        myItem.Send
        Else:
        myItem.Delete
        MsgBox "Not sent"
        End If
    Next AddCell
    Set ol = Nothing
Workbook.Close
End Sub


Thanks for all your help

Regards,
Shekar.


Hi, I'm new to this site. It looks great. Sounds like you all have lots of experience.

I'm a primary school class representative and I want to create an excel contact list of the parents email addresses so that I can click a button, it will open the default email (in my case MS Outlook) and then populate the "To" email address field with the email addresses (separated by a comma).

Can anyone provide me the VB code that I can paste into my worksheet VBA that will look at a range of cells (say E2:E30) that contain email addresses, and put them in the "To" field of a blank email?

I have put a button on the page and it's called "EmailButton" but I don't know what VB to put with it. I'm using MSExcel 2007 (at home) and 2003 (at work)

Thanks




Hello,

I am stumped and would appreciate some direction on how to solve this issue:

Below, Range D62 and Range D63 contain first and last names of email recipients, but does not include their "email" name. I use the following to create the email but I want to have Outlook "Check Names" before sending. Any guidance on how I can accomplish this?

Thank you!!

'Send email message
Dim objOL As Object
Dim objMail As Object
Dim sEmail As String
Dim sEmailColumn As String
Dim sSubject As String
Dim sBody As String
Dim Signature As String
Dim lDataRow As Long
Dim cl As Range
Dim StrTo

StrTo = Range("d61")
sSubject = "Test" & Range("D6") & Space(2) & Range("D7")

sBody = "** TEST **" & vbNewLine & vbNewLine & Range("D46") & _
vbNewLine & vbNewLine & Range("D51") & vbNewLine

'Bind to Outlook
Set objOL = CreateObject("Outlook.Application")

'Create a new email and send it
Set objMail = objOL.CreateItem(0) '0=olmailitem

With objMail
objMail.Display
End With
Signature = objMail.body

With objMail
objMail.To = StrTo
objMail.CC = "QualityControl@testing.com;" & "Name1@testing.com;" & Range("d62") & ";" & Range("d63") & ";"
objMail.Subject = sSubject
objMail.body = sBody & vbNewLine & Signature
End With

'Turn on error handling
On Error GoTo Cleanup
Cleanup:
'Release all objects
Set objMail = Nothing
Set objOL = Nothing
On Error GoTo 0

Dear all,

I am new to Outlook VBA, but based on my (limited) experience, I am sure that the following problem should be solvable. Any help or pointers would be much appreciated)!

1) I have multiple email accounts in Outlook.
2) I am trying to write a macro that will engage after I click "send" on an email, then...
a) check recipients' email addresses (domains)
b) based on results, warn me if I am sending the message through the wrong account

For example:

Whenever I send an email (to or cc) to someone with an .edu address, I would like to send it through my .edu account. Whenever I write to a .com address, I'd like to email from my personal account.

I know you all have limited time - if anyone can help, it would be wonderful. Thanks!

as


Hi everyone,

I have an excel 2003 spreadsheet with a list of emails. I was wondering how I could click any one of those email links and have it open outlook 2003 (which it already does automatically) with my confirmation template already placed in the body of the email (which it obviously does not do automatically). If it's relatively simple to have it populate a standard email subject line as well that would be icing on the cake.

Thanks in advance.


Good morning folks
Hopefully this is just something daft, but it has me baffled right now.
I've received an xls file via email and when it opens up (Excel 2007 here) it has what appears to be an Outlook email sending tool bar embedded above the formula bar with a To, cc and subject window and various Outlook messaging buttons on a toolbar. I've trawled through the settings and cannot find any reference to it. I've not seen it before, so a new one to me. Anyone recognise it and know how I can get rid of it please?
Thanks




In my Excel spreadsheet I have a column to store the email addresses of my clients. Every time I click on the text of an email address, it automatically opens Outlook with a new message composed to that address. How do I stop this from happening? I don't even use Outlook for my email and this is really frustrating. I've tried changing the format of the column to no avail.

Thank you; your help is most appreciated.


My goal is to create a macro in Excel to produce an email in Outlook to all the email addresses listed in column I in one email in the "To:" field.

What I've accomplished in the following VBA is that it creates a separate email for each email address listed in column I.

How do I create just one email for the list of email addresses in column I?

Typing in the email addresses within the VBA is not an option. The list of email addresses change with another macro.

Thank you in advance.

-Erica


Sub SendEmail()

Dim OutlookApp As Outlook.Application
Dim MItem As Outlook.MailItem
Dim cell As Range
Dim Subj As String
Dim EmailAddr As String
Dim Recipient As String
Dim Msg As String

'Create Outlook object
Set OutlookApp = New Outlook.Application

'Loop through the rows
For Each cell In Columns("I").Cells.SpecialCells(xlCellTypeVisible)
If cell.Value Like "*@*" Then

'Get the data
Subj = "This is the Subject Field"
Recipient = cell.Offset(0, -1).Value
EmailAddr = cell.Value

'Compose Message
Msg = Recipient & vbCrLf
Msg = Msg & "Please review the following message."

'Create Mail Item and view before sending
Set MItem = OutlookApp.CreateItem(olMailItem)
With MItem
.To = EmailAddr
.Subject = Subj
.Body = Msg
.Display
End With
End If
Next

End Sub


Hi,

I have a workbook in which there is a macro that needs to, when clicked, open an Outlook email and attach the workbook to it. I have found a macro to do this, but it also sends the email.

I need one that doesn't send the email because the user needs to attach an image and a logo (it's a booking form for an online auction website) before the email is sent.

Does anyone know code for a macro that attaches the workbook to the email, but does not send the email, instead letting the user edit the email before choosing to send it themselves?

Hope that is clear, if not please let me know if more info is needed.

Thanks


Hi,

Is it possible to run a macro in Excel that will copy data on a sheet and paste it in the body of an Outlook email? I know that by clicking an email address link in Excel it will open a new Outlook email message. I would like to then paste copied data from Excel. Both programs are Microsoft Office but is this possible?


I guess I already did this wrong on my frist time post....I do hope this post is better....

Hello all! I'm working with an excel file, a userform and a command button. The command button is the main question here. Bascally when this button is clicked and email is sent to a specific person, me. This email also contains an attachment, and currently that is the active workbook open behind the userform. This works well, sort of. I sent this excel file to 5 co-workers to test. All but 1 worked OK. One, however, did not.

When the button was selected the standard Outlook message came up: "...an automated email is being sent on your behalf...select YES to continue..."...It all looks fine, but nothing happens...nothing shows up in their sent items folder and I do not receive this message.

Has anyone experienced this before? Is there a sitting with this users Outlook that prohibits the sending of automatic emails? Any ideas? I've added my command button code below...incase someone sees thing strange...(I am rather new to vba coding...)

Code:

Private Sub CommandButton5_Click()

Dim OutApp As Object
Dim OutMail As Object

Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)

On Error Resume Next
With OutMail
.To = "name@at.com"
.CC = ""
.BCC = ""
.Subject = "Merit 2009 - " & txbSupLast
.Body = "This message was sent via a button on the form..."
.Attachments.Add ActiveWorkbook.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
End With
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing

End Sub





I am using VBA to automatically send emails with Outlook. I am surprised that the VBA takes about 10 seconds for each email.

Exceprts from my code are below. Is there anyway to speed this up?

Code:

Sub SendMessage(Recipient, Message, Subject)
Dim MyEmailVariable As Outlook.MailItem
Set MyEmailVariable = MyOutlookVariable.CreateItem(olMailItem) 'Begin new email
' 
MyEmailVariable.To = Recipient                   'Set the person sending to
MyEmailVariable.Subject = Subject              'Set the Subject of the message
MyEmailVariable.Body = Message                 'Set the body of the message
MyEmailVariable.Attachments.Add "C:\Dummy Attachment.XLSX"     MyEmailVariable.Send                         
End Sub





I am a novice with VBA, but came across this post [/url]which is related to my question.

I am interested in an excel button that when clicked captures a screenshot of the excel page and either attaches it to- or embeds it in- an outlook email. The recipient of the email can be manually entered.

Thanks in advance,

Will


Hello,

I have vba code to batch email a number of "orders" in MS-Access. However,
for each recipient I receive a warning message that "A program is
automatically trying to send email on your behalf..."

This is a multi-site environment where I do not have control over Outlook's
administration settings.

Is there a workaround?

Is there a COM add-in available through a third party, to circumvent this?


it is possible to auto populate outlook email with data in excel via a macro button?
ie in a1 is the email address
a2 is the subject header
and a3 is the body?

chheers in advance


Each day I get an email that is autogenerated by a system at a specific time. I would like for Excel to search my email and open the file in the previous day's email... I have used rules for these specific emails to go into their own folder

How would I go about opening up emails and saving the attachments to a folder on my desktop? And how do I limit the date range so it doesn't want to open all my emails? I am able to do everything else I need after that, but need help with VBA in Excel to deal with Outlook.

I am unfamiliar with the objects using Outlook so this will be a good learning situation for me... I want to just open the attachment the attachment from the previous day and only emails with a specific subject name... any help would be greatly appreciated