Solved

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

Posted on 2015-01-06
6
361 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
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…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

695 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