InfoPath 2010 Cookbook 4

Who is this book for?

InfoPath 2010 Cookbook 4 is for Visual Basic .NET developers who have already mastered the
basics of designing form templates in InfoPath 2010 without writing code
and who now want to extend the functionality of InfoPath 2010 forms through code.

This book is NOT for InfoPath users who cannot already read and write
VB .NET code, since it does not teach VB .NET from the ground up.

The level of this book ranges between beginner and advanced and it is ENTIRELY ABOUT WRITING CODE!!!

101 step-by-step tutorials or solutions that have a Problem-Solution-Discussion format

If you are looking for an InfoPath 2010 with C# programming book, have a look at InfoPath 2010 Cookbook 3.
InfoPath 2010 Cookbook 4 is the Visual Basic version of InfoPath 2010 Cookbook 3, so everything you
can do with C# you can also do with VB.

Full Table of Contents

Chapter 1: Getting Started
1. Install Visual Studio Tools for Applications
2. Set or change the form template code language to Visual Basic
3. Create a new Visual Basic project for a form template
4. Remove code and project files from a form template
5. Associate a form template with an existing Visual Basic project

Chapter 2: Basics of Programming for InfoPath
6. Add an event handler for a form event
7. Add an event handler for a control event
8. Access the Main data source of a form
9. Access a secondary data source of a form
10. Get the value of a field
11. Set the value of a field
12. Clear a field on a form
13. Clear all fields on a form
14. Add error-handling to an InfoPath form
15. Debug code of an InfoPath form template in VSTA

Chapter 3: Views
16. Switch to show a specific view when a form opens
17. Switch to a read-only view when a form is submitted
18. Save form data to a PDF file on disk

Chapter 4: Data Validation
19. Validate a field when its value changes
20. Validate a field when a button is clicked
21. Check for a specific error in a form
22. Clear a specific validation error in a form
23. Ignore and clear all errors in a form before submit

Chapter 5: Controls
24. Retrieve design information for a control on a view
25. Hide or disable a control
26. Set the value of a decimal field
27. Validate that data entered is a decimal number
28. Display the current time in a text box on a form
29. Embed HTML in an InfoPath form
30. Add a line-break to a rich text box
31. Clear a rich text box
32. Validate that a rich text box has no more than 5 lines
33. Select an item in a drop-down list box
34. Populate a drop-down list box
35. Select or deselect a check box
36. Select a specific option from a list of options
37. Get the value of a date and time picker control
38. Set the value of a date and time picker control
39. Calculate the difference between two date pickers
40. Select an item in a multiple-selection list box
41. Deselect an item in a multiple-selection list box
42. Select all items in a multiple-selection list box
43. Deselect all items in a multiple-selection list box
44. Validate that at least 3 items have been selected in a multi-select list box
45. Add an item to a bulleted list
46. Remove all items from a bulleted list
47. Set the (default) value of a person/group picker control
48. Get the selected user(s) from a person/group picker
49. Retrieve profile information for a user selected from a person/group picker
50. Clear a person/group picker control
51. Load a file from disk into an attachment control
52. Load a resource file into an attachment control
53. Save a file from an attachment control to disk
54. Rename a file in an attachment control
55. Restrict the size of a file in an attachment control
56. Restrict file types for a file in an attachment control
57. Delete a file from an attachment control
58. Load an image from disk into a picture control
59. Load an image resource file into a picture control
60. Load an image from the web into a picture control
61. Load an image as a link into a picture control
62. Extract an image from a picture control
63. Extract the file extension from a picture control
64. Validate the size of an image in a picture control
65. Clear a picture control
66. Add or remove an optional section when a check box is selected or deselected
67. Add a choice section when a form opens
68. Add a choice section based on a selected option
69. Retrieve a row of a repeating table
70. Loop through rows of a repeating table
71. Add a row to a repeating table
72. Delete rows of a repeating table
73. Retrieve the value of a field in the same row of a repeating table
74. Copy data from a data source to a repeating table
75. Sort rows of a repeating table
76. Filter rows of a repeating table

Chapter 6: Working with InfoPath Form Data
77. Sequentially traverse all fields of a form
78. 3 Ways to open and read an InfoPath form in memory
79. Programmatically create an InfoPath form
80. Convert a form to Word using the Open XML SDK 2.0

Chapter 7: Web Service Integration
81. Create a web service that retrieves data for InfoPath
82. Submit form field values to a web service
83. Submit repeating table data to a web service
84. Submit an entire form to a web service
85. Retrieve return values after data has been submitted to a web service

Chapter 8: Database Integration
86. Perform a wildcard search on an Access table
87. Retrieve data from an Access table with Memo field
88. Perform create, update, and delete actions on an Access table with Memo field
89. Retrieve data from SQL Server using a stored procedure
90. Submit an entire InfoPath form to SQL Server
91. Retrieve an entire InfoPath form from SQL Server

Chapter 9: SharePoint Integration
92. Add an item to a list using the SharePoint client object model
93. Populate form fields from query string parameters
94. Select and add files from a document library as attachments to a form
95. Submit repeating table data to a SharePoint list to create new list items
96. Submit a form to libraries on two different sites in the same site collection
97. Use an InfoPath form to add a recurring all day event to a SharePoint calendar
98. Use an InfoPath form to upload a file to a SharePoint document library
99. Auto-number InfoPath forms in a form library
100. Use an InfoPath form to send an email with attachments
101. Save a form as a PDF document in a SharePoint document library