Solved

Outlook 2010: Need macro to add voting buttons to current message

Posted on 2015-01-06
6
313 Views
Last Modified: 2015-01-13
I need a macro to automatically add voting buttons to the active message draft.

This is for our word processing department.  When they return a job by replying to the original message, I want them to be able to run a macro that will add voting buttons labeled 1 through 10, so the recipient can quickly rate the quality of the job.

I can find macros that create a new message with voting buttons, but I want to simply add them to the currently drafted message.  I am familiar with Word VBA, but not as familiar with Outlook VBA.
0
Comment
Question by:Dave Kong
  • 4
  • 2
6 Comments
 
LVL 2

Expert Comment

by:Pratik Makwana
ID: 40534985
Please Refer this site : HELP
0
 

Author Comment

by:Dave Kong
ID: 40536567
Pratik:

Thank you for the link.  I already know how to simply create custom voting buttons in a message.  What I need is a macro that can set it up automatically.  It is unrealistic that my processors can take the time to manually set up 10 different buttons.  A macro would make it super easy for them, and therefore more likely that they will include it in responses.

Dave
0
 
LVL 2

Expert Comment

by:Pratik Makwana
ID: 40537208
Use Msg.VotingOptions = "Yes;No;Maybe So" in below code.....
Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Sub TestMacro()
Dim Email As String, Subj As String
Dim Msg As String, URL As String
Dim r As Integer, x As Double
For r = 2 To 3 'data in rows 2-3
' Get the email address
Email = Cells(r, 2)

' Message subject
Subj = Cells(r, 4)
' Compose the message
Msg = ""
Msg = Msg & "Dear " & Cells(r, 1) & "," & vbCrLf & vbCrLf
Msg = Msg & "This is regarding a PeS query "
Msg = Msg & Cells(r, 3).Text & "." & vbCrLf & vbCrLf
Msg = Msg & "Please let us know if you are using this query or can it be archived" & "." & vbCrLf & vbCrLf
Msg = Msg & "Velmurugan" & "," & vbCrLf
Msg = Msg & "HR Ops Analyst," & vbCrLf
Msg = Msg & "Global Reporting Operations Team."

' Replace spaces with %20 (hex)
Subj = Application.WorksheetFunction.Substitute(Subj, " ", "%20")
Msg = Application.WorksheetFunction.Substitute(Msg, " ", "%20")

' Replace carriage returns with %0D%0A (hex)
Msg = Application.WorksheetFunction.Substitute(Msg, vbCrLf, "%0D%0A") ' Create the URL
URL = "mailto:" & Email & "?subject=" & Subj & "&body=" & Msg
' Execute the URL (start the email client)
ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus
' Wait two seconds before sending keystrokes
Application.Wait (Now + TimeValue("0:00:02"))
Application.SendKeys "%s"
Next r
End Sub

Open in new window

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:Dave Kong
ID: 40539104
Pratik:

Thanks for posting this.  However, I am looking over the code and not seeing any line that involves voting buttons.  Am I missing it?

Dave
0
 

Accepted Solution

by:
Dave Kong earned 0 total points
ID: 40539464
Pratik:

I am short on time to complete this project and not finding any quick answers.  As an alternative, I have decided to create a custom message form that will have the voting buttons I need built in.  That is not quite as elegant or as versatile, but it will work.  Thanks for your help.

Dave
0
 

Author Closing Comment

by:Dave Kong
ID: 40546234
I am only accepting this solution because I have limited time before I have to present a draft.  Using a custom form is nowhere near as cool as the macro would have been, and I see from various posts evidence that it COULD be done.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now