Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is a photo placeholder possible

Status
Not open for further replies.

stancer

Programmer
Jan 16, 2003
27
0
0
US
Two questions...
I've created a form with a one cell table on the left portion of the page containing fill-in text boxes, and a frame to the right of the table where a mugshot photo is placed. As it stands now, the form must be unlocked in order to replace the photo, then locked again to fill in the text boxes. I was wondering if there is any way, VB or procedure, to have an end-user simply click the photo "placeholder" frame while the form is locked and be prompted to select a photo (file) to be inserted in the frame? No one I've talked to seems to have an answer other than the unlock/lock method.
Additionally, I would also like to be able to insert a duplicate page in the current document similar to the insert duplicate slide in PowerPoint. I've tried to insert the template again as a file insertion, but the table and frame are lost.
Are either of these questions possible, VBA or otherwise?

-Dave-
 
Use ActiveX textbox Controls, rather than text Form Fields. Unless there is a specific reason that you need to lock the form, as opposed to locking the document (oer worksheet- whatever).

Gerry
 
ETID - Sorry... I'm using Word 2000

Fumei - I'm not a Word power user, but am proficient in Access, and am not familiar with the controls available to Word and how to use them. I can muddle around until either I get frustrated or, perhaps you mifgt have an example of how to use an ActiveX control in this situation? Any help would be appreciated. As far as locking the form, that's the only I know to enable the text boxes. Other ideas?

Thanks for any help you all can give!

-Dave-
 
A solution found! Very Cool!!
Found this elegantly simple solution on a Microsoft forum, from Jay Freedman, Microsoft Word MVP.

Posted here for all who can or want to use this technique to insert a picture in a Word doc form.

********************************************************

Although the command isn't available while protection is turned on, nothing
says the protection has to stay turned on throughout the macro. :) Try
this:

Sub InsPic()
Dim ProtType As WdProtectionType

If Selection.FormFields.Count > 0 Then
' not a textbox but a checkbox or dropdown
' see Exit Sub
End If

ProtType = ActiveDocument.ProtectionType
If ProtType <> wdNoProtection Then
ActiveDocument.Unprotect
End If

Dialogs(wdDialogInsertPicture).Show

ActiveDocument.Protect Type:=ProtType, _
NoReset:=True
End Sub

Since the cursor will be inside a form field when the macro starts, and the
..Show method inserts the picture at the cursor, you get a picture inside a
form field -- but only if it's a text box form field, not a checkbox or a
dropdown (those would be completely replaced by the picture).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top