Outlook Tips & Techniques: Using Voting Buttons in a Public Folder

Learn to add voting buttons to custom forms that are used to post in a public folder and how to get a count of all the votes.

Sue Mosher

January 30, 2005

3 Min Read
ITPro Today logo in a gray background | ITPro Today


Can I use voting buttons to tally responses to a post in a public folder? For example, if I have a public folder that contains restaurant reviews, could a user post a review that includes voting buttons so that everyone else can simply cast a vote instead of responding to the thread? Long threads make it hard to get a picture of how many are voting for or against an idea.

Yes, you can add voting buttons to forms that you use to post in a public folder. However, you won't get the same results as with voting-button messages because Outlook tallies only voting-button responses that arrive in the Inbox and match a message in the Sent Items folder. Outlook can't automatically tally voting-button responses in a public folder.

Still, voting buttons have a lot of appeal because they provide convenient commands on a right-click context menu so that users can record their votes. With just a little bit of code behind a custom post form, you can record each user's response in a custom property named Vote, which you need to add to the public folder by using the folder's Field Chooser. Set up a table view for the folder with two levels of grouping—by Conversation and by the Vote field. The responses for each voting button will appear in a separate group.

To create the custom post form with voting buttons and the necessary code, open a post form in design mode with the Tools, Forms, Design a Form command. Click the (Actions) tab. Double-click the Reply to Folder action, clear the Enabled box, and click OK. Depending on the purpose of your folder application, you might also want to disable the Reply and Forward actions.

Next, create your first voting button by clicking the New button on the (Actions) tab and setting the various options to the values shown in Table 1. After you type IPM.Post into the Form name box and click Check, Outlook will change the form name to Post and show IPM.Post for the message class. Web Figure 1 (http://www.windowsitpro.com/microsoftexchangeoutlook, InstantDoc ID 45072) shows an action set up for an I Like It voting button that prefixes the subject in the response with the text Like:. Repeat the process for each voting button that you want to include on the item.

Choose Form, View Code, and add to the form the code that Web Listing 1 shows. The code's CustomAction event handler fires whenever the user clicks a voting button. The event handler adds the Vote custom property to the response item and sets the value of that property to the name of the voting button. Finally, it displays the response and closes the original item.

Finally, on the (All Fields) tab, under User-defined fields in folder, set the value of the Vote property to the value you want the original items—the ones being voted on—to display. For example, in a folder for restaurant reviews, you might use the text Restaurant review.

Use the Tools, Forms, Publish Form command to publish the customized post form to the public folder and, on the folder's Properties dialog box, make it the folder's default form. Users will see the custom form whenever they click New in that folder.

After you have some posts with votes, you'll probably want to get a count of all the votes. Select all the items in the folder and mark them as unread with the Edit, Mark as Unread command. Then choose View, Expand/Collapse Groups, Collapse All Groups. You'll see a group for each original post. Click the plus (+) sign next to a group to expand it and see the next grouping level, by Vote, as Web Figure 2 shows.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like