I've been searching the web for how to populate a drop down list with all available SharePoint users and although I did manage to find things, it wasn't exactly what I was looking for. The solutions I found did not list all users and it lists groups in there too (which I did not want). Anyway, after searching some more, I found something called a Contact Selector for InfoPath. The Contact Selector is an ActiveX control which is installed with InfoPath 2007. There are 2 main steps to get the Contact Selector to work however there is a third step if you plan on using the Contact Selector more than once on a single form (which I had to do in my case).
Step 1 - Add the Contact Selector to InfoPath 2007
- In Office InfoPath 2007, on the Design Tasks pane, click Controls.
- On the Controls pane, click Add or Remove Custom Controls.
- In the Add or Remove Custom Controls dialog box, click Add.
- The Add Custom Control Wizard appears.
- Under Select a Control Type, select ActiveX Control. Click Next.
- In the list of ActiveX controls, select Contact Selector. Click Next.
- Under Specify Installation Options, select Don’t include in a .cab file. Click Next.
- Under Binding property, select value. Click Next.
- For Field or group type, select Field or group (any data type). Click Finish. Click Close. Click OK.
Step 2 - Configuring the Contact Selector
- Open your form in Design mode in InfoPath 2007.
- Select View-Design Tasks from the menu.
- Click the Data Source link.
- Right-click in the section where you want to add the control and select "Add…". Specify a name. Set the Type option to Group. Do not check the repeating check box. Click OK to save.
- Right-click the new group added in the previous step and select "Add…". For the name, type in Person. Set the Type option to Group. Check the repeating check box. Click OK to save.
- Right-click on the Person group and select "Add…". For the name, type in DisplayName. Click OK to save.
- Right-click on the Person group and select "Add…". For the name, type in AccountId. Click OK to save.
- Right-click on the Person group and select "Add…". For the name, type in AccountType. Click OK to save.
- Drag the group created in step #5 to the location in your form where you want the Contact Selector to be displayed. A popup menu will display – select Contact Selector.
- Open a text editor (eg. Notepad).
- Type in the following and replace yourservername: <Context siteUrl="http://<yourservername>"/>
- Save the file as Context.xml.
- In InfoPath, select Tools-Data Connections from the menu.
- Click the Add button, check the "Create a new connection to" option, and check the "Receive data" option. Click the Next button.
- Check the "Xml document" option. Click the Next button.
- Browse to the location where you saved the Context.xml file and open it. Click the Next button.
- Check the "Include the data as a resource file in the form template or template part" option. Click the Next button.
- Enter the name Context. Click the Finish button.
- Save the form.
- Publish the form.
Now if you try adding a second Contact Selector and publish the form, you'll get an error.
To be able to use more than 1 Contact Selector, you need to complete Step 3.
Step 3 - Using multiple Contact Selectors in a single form
- Complete Step 2.4 above for every contact selector you want to add.
- Right click on the Person group and click on "Reference"
- A window should pop up. Select the group that you created above in Step 3.1
- Drag and drop the group to the location where you want the Contact Selector to appear on your form. When the popup menu is displayed, select Contact Selector
And there you have it. You now have the ability to select users from SharePoint. From here, you can create workflows that involve these selected users from SharePoint Designer by setting these fields as being available in SharePoint sites (when publishing), but that's another story.