PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Voting Buttons

Reply

Voting Buttons

 
Thread Tools Rate Thread
Old 16-02-2004, 07:57 PM   #1
Wanda
Guest
 
Posts: n/a
Default Voting Buttons


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
  Reply With Quote
Old 16-02-2004, 08:20 PM   #2
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: Voting Buttons

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.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Wanda" <anonymous@discussions.microsoft.com> wrote in message
news:114bc01c3f4c7$1456fbe0$a401280a@phx.gbl...
> 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



  Reply With Quote
Old 20-02-2004, 01:44 PM   #3
Randal W. Hozeski
Guest
 
Posts: n/a
Default Voting Buttons

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-




>-----Original Message-----
>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
>.
>

  Reply With Quote
Old 20-02-2004, 03:00 PM   #4
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: Voting Buttons

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
http://www.outlookcode.com/jumpstart.aspx


"Randal W. Hozeski" <hozeski.randalw@rwhinc.us> wrote in message
news:13b2101c3f7b7$a4558610$a401280a@phx.gbl...
> 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-
>
>
>
>
> >-----Original Message-----
> >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
> >.
> >



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off