Solved

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

Posted on 2015-01-06
6
338 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Some time ago I was asked to create a VBA function that would calculate a check digit for an input number, using the following procedure: First, sum up all the individual digits in the number If that sum value has more than one digit, then sum up …
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.

828 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