Include attachments, pictures, or hyperlinks

A Microsoft InfoPath 2010 form template can include different types of controls designed to collect or display information as an object — file attachments, pictures, and hyperlinks.

In this article


About attachment, picture, and hyperlink controls

File Attachment

The file attachment control enables users to attach a file to a form when it is submitted. For example, if users are filling out an insurance report form, the file attachment control can be used to attach a PDF document of the insurance claim to the form.

Use a file attachment control when you want to:

  • Enable users to attach a file to the form when they submit it.

Picture control

A Picture control enables users to insert a picture in the form when filling it out. The picture data is then saved in the underlying form. When a picture control is added to a form template, an empty picture control is inserted by default. A default picture can also be specified.

You can also specify whether users can delete or replace a picture that you have inserted into a picture control. If you have not specified a default picture, users are presented with a picture icon and the text Click here to insert a picture. By default, when a user inserts a picture, the picture control is automatically resized to accommodate the picture. However, you can set the size of the picture control, which resizes the inserted picture to the specified size.

Use a picture control when you want to:

  • Allow users to insert pictures, including photos, clip art, and drawings.
  • Add a temporary picture to a form template that can be deleted or replaced by the user, such as a placeholder photo.
  • Display images on a form template that are retrieved from a database or other external data source.
  • Display a picture that changes based on logic in the form. For example, when a name from a person picker control is clicked, the image in the picture control changes to display that person’s image.

Ink picture control

By including an ink picture control on a form template, tablet PC users can draw and write on top of a picture or in a blank space on an InfoPath form. When an ink picture control is added to a form template, an empty ink picture control is inserted by default. You can also add a picture to the background of this control. This enables users to draw directly on top of the picture with a tablet pen. For example, on an insurance claim form template, an insurance adjuster can circle areas of damage on a picture of a car.

 Note    Ink picture controls are not a secure method of collecting and saving user signatures. If you want to collect and save signatures from users, it is recommended that you use digital signatures.

Use an ink picture control when you want to:

  • Provide tablet PC users a place on the form where they can write or draw. This is useful when you want users to be able to sketch something that is complicated or technical, such as a mathematical formula or a diagram of a particular business process.

In the following example, an ink picture control is used to collect a sketch of an automobile accident on an insurance claim form template.

Ink picture control for collecting sketches from users

Hyperlink

The hyperlink control enables users to insert or edit a hyperlink on the form. Users editing and viewing the form can click the hyperlink which automatically opens the Web browser to the location that the link points to. This is useful when you are required to input a hyperlink as part of the form.

Use a hyperlink control when you want to:

  • Collect the address of a Web site from a user.
  • Display the address of a Web site to a user.

Top of Page Top of Page

Insert an attachment, picture, or hyperlink control

The procedure for inserting a control differs slightly depending on whether you are designing a new, blank form template or basing the design of the form template on a database or other external data source.

Insert a control in a new, blank form template

  1. On the form template, place the cursor where you want to insert the control.
  2. On the Home tab, in the Controls group, click the type of control to insert.

Include attachments, pictures, or hyperlinks

  1. If you are inserting a picture control, do one of the following on the Insert Picture Control dialog box:

Include attachments, pictures, or hyperlinks

  • To save the picture data in the form, click Included in the form, and then click OK. When you select this option, the picture data is encoded into the form. Including the picture in the form is a good choice if you want to keep the form and its data portable.
  • To display an external picture by linking to it, but not saving it in the form, click As a link, and then click OK. When you select this option, a hyperlink is saved in the form that links to the picture data on the remote site. Linking to a picture is a good choice if you think that users will update the linked picture, or if you want to reduce the file size of the form.

 Note    When viewing linked images on a form, users must have access to the location of the picture source file. Otherwise, the picture will not appear on the form.

  1. To add a label to the control, type text above or next to the control. For example, if you inserted a hyperlink control that links to your company’s Web page, you can type, “Web page”.

Insert a control on a form template that is based on an existing data source

If you base the design of a form template on an external data source, the fields and groups in the Fields task pane are retrieved from the external source. In this scenario, you can insert a control by dragging a field from the Fields task pane onto the form or by inserting a control, as described in the following procedure:

  1. On the form template, place the cursor where you want to insert the control.
  2. Right-click on the appropriate field from the external data source in the Fields task pane.
  3. Select the type of control to insert that is compatible with the data type.
  4. The name of the field or group is used as the control's label. If necessary, change the label text.

 Tip    You can also drag the field from the Fields task pane to the form. If you do this, the most appropriate control is chosen based on the field type. If the correct type is not selected by default, use the previous method to select the correct type.

Top of Page Top of Page

Attachment, picture, and hyperlink control options

Picture and ink picture control layout tips

Use the following tips to help you refine the appearance, size, and other aspects of an ink picture or a picture control:

  • For ink picture controls, adjust the size of the control to fit the size of the picture that you expect a user to draw.
  • If you want an ink picture or picture control to be limited to a specified area of your form and not expand to display the entire picture that a user either attaches or draws, insert the ink picture or picture control with a specified height and width.
  • To change the width of several ink picture or picture controls at the same time, select the controls whose size you want to change, press ALT+ENTER, click the Size tab, and then enter the desired size in the Width box.

Specify a background or default picture in an ink picture or picture control

For picture controls that have the picture data saved in the forms, and for ink picture controls, you can specify a background, or default image, for the control as follows:

  1. Select the desired ink picture or picture control.
  2. Under Control Tools, on the Properties tab, in the Properties group, click Control Properties.

Include attachments, pictures, or hyperlinks

  1. If this is a picture control, click Specify default picture, and then click Browse.

 Note    This option is not available if the picture control was inserted as a link.

  1. If this is an ink picture control, click Use a background picture.
  2. Select the desired picture, and then click Insert.

Specify the value of a hyperlink control

  1. Right-click on the field that the hyperlink control is bound to in the Fields task pane.
  2. Click Properties.
  3. Enter the desired URL in the Value box.

 Note    You can use an XPath expression to calculate a dynamic hyperlink. For more information, see Add Formulas and Functions in InfoPath 2010.

Include attachments, pictures, or hyperlinks

  1. If you want to make the hyperlink control read-only so that users cannot change it when filling out the form:
    1. Select the desired hyperlink control.
    2. Under Control Properties, on the Properties tab, in the Properties group, click Control Properties.
    3. On the Data tab, select the Read-Only check box.

Attach a default file to a File Attachment control

  1. Select the desired File Attachment control.
  2. Click Specify default file.
  3. Click Browse.
  4. Select the desired file, and then click Insert.

Top of Page Top of Page

 
 
Applies to:
InfoPath 2010