?
Solved

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

Posted on 2015-01-06
6
Medium Priority
?
384 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 IT Pros

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 …
Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

801 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