Voting Buttons

W

Wanda

I need to invoke a message that has voting buttons. I
created the code and I don't get error messages and it
seems to work for the most part, but my buttons don't
appear. Can you tell me where I am going wrong? Thanks.
***********************

Sub cmdSelVoteMsg_Click()
CreateVoteMessage
End Sub

Sub CreateVoteMessage()
Dim objApp
Dim strMsg
Dim strActions
Dim strButtonAction
Dim objMessage
Dim objAction

strMsg = "Enter the necessary voting button titles,
separated by semicolons."
strActions = InputBox(strMsg, "Create Vote Buttons")
If strActions <> "" Then
'msgbox strActions
Set objApp = CreateObject("Outlook.Application")
Set objMessage = objApp.CreateItem(0)

Do
If InStr(1, strActions, ";") > 0 Then
strButtonAction = Mid(strActions, 1, InStr(1,
strActions, ";") - 1)
strActions = Mid(strActions, InStr(1,
strActions, ";") + 1)
Else
strButtonAction = strActions
strActions = ""
End If

Set objAction = objMessage.Actions.Add
With objAction
.CopyLike = (0)
.Enabled = True
.Name = strButtonAction
.Prefix = "Re: "
.ReplyStyle = (2)
.ResponseStyle = (2)
.ShowOn = (2)
End With
Loop Until strActions = ""

objMessage.Display
End If

Set objApp = Nothing
Set objMessage = Nothing
Set objAction = Nothing
End Sub
 
S

Sue Mosher [MVP-Outlook]

You will never see voting buttons as you are composing a message, unless you
look on the Options dialog. Voting buttons appear only on the received
message.
 
R

Randal W. Hozeski

I am curious as to getting this to work for me, but when
trying to execute I get the following error:

"The macros in this project are disabled. Please refer
to the online help or documentation of the host
application to determine how to enable the macros"

I followed the help documentation to enable with no
luck. It said that it enbled the share but yet I receive
the same error.

Would like to know more about how this works? Does the
receipent need to be running OL? and what kind of reply
do you receive?

Please advise and thanks. -Randy-
 
S

Sue Mosher [MVP-Outlook]

Tools | Macros | Security. Restart Outlook after resetting the security
level.

The code you cited simply creates a voting button message. If the recipient
does not have Outlook, it won't have voting buttons. If it does and they
reply, you'll receive a standard voting button response. Try it and see for
yourself!
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top