Hi Craig
Word doesn't have a form field that can hold a picture. There is a
workaround, though. With a macro you can unprotect the document momentarily,
insert the picture, and reprotect the document.
First copy/paste this macro into a module of the template (see
http://www.gmayor.com/installing_macro.htm):
Public Sub ProtectedInsertPicture()
Dim ilsPicture As InlineShape
Dim strFileName As String
Dim sngRatio As Single
Const max_width = 216 ' = 3 inches (in points)
' temporarily unprotect
ActiveDocument.Unprotect
' show Insert Picture dialog
With Dialogs(wdDialogInsertPicture)
If .Display = 0 Then Exit Sub
strFileName = .Name
End With
' remove macrobutton
Selection.Delete
Set ilsPicture = ActiveDocument.InlineShapes _
.AddPicture( _
FileName:=strFileName, _
LinkToFile:=False, _
SaveWithDocument:=True, _
Range:=Selection.Range)
' limit size of picture to max_width (optional)
With ilsPicture
If .Width > max_width Then
sngRatio = CSng(max_width) / .Width
.Width = max_width
.Height = .Height * sngRatio
End If
End With
' reprotect, keeping form field contents intact
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
NoReset:=True
End Sub
Then insert a MacroButton field at each place where the user should be able
to insert a picture, using the field code
{ MacroButton ProtectedInsertPicture Double-click to add picture }
You can use font, border, and shading formatting to make the "Double-click"
part look like a rectangula button. Press Ctrl+A and then F9 to update the
fields. Protect and save the template.
When the user creates a new form from the template and fills it in, s/he can
double-click the "button" even though it's in a protected area of the
document. The macro will unprotect, pop up the Insert > Picture > From File
dialog, insert the picture (replacing the macrobutton), and reprotect. The
optional section of the macro will resize the picture if it's wider than the
number of points you assign to max_width -- if you don't need that, just
delete the section of code between With ilsPicture and End With.