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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

insert a graphic to a MS word form document

Status
Not open for further replies.

DRowland

Programmer
May 23, 2001
232
US
Is there a way to insert a picture into a MS word document that is protected as a form?
I know how to do text formfields, but can't find a graphic formfield.
Any help will be appreciated.

Dick

|========================|
I sure wish there was a way
to receive the best teaching, [smarty]
without having to go through
some of the worst experiences![ponder]
|========================|
 
There is no graphic formfield.

There is a ActiveX field that will take images. However, you can also insert images in sections that are NOT protected for forms. Use Continuous sections. Continuous sections can be as samll as you like. When you are protecting the document for forms, just leave where you are onserting the graphic unprotected.

Gerry
 
macropod:
I guess I don't understand how to do this.
Let's try a better explanation.
I have a protected form, with form fields for text.
I also have a picture that I copied from another spot, and want to paste it into a form field. Can you tell me, in 3rd grade english if that is possible? Sorry for the demands, but I tried what you explained to the best of my ability, and got nowhere.
Thanks again.

Dick

|========================|
I sure wish there was a way
to receive the best teaching, [smarty]
without having to go through
some of the worst experiences![ponder]
|========================|
 
Yes. However, again, please be careful of language. Coding is a very literal thing. Reading your post it sounds like you want to drop an image (by cut and paste unfortunately) INTO a formfield. NOT, repeat, NOT into someplace else in the document, but into a formfield itself.

Is that is so, Here is how you do it with code, but it is not cut and paste. It is dropping an image file into a formfield named "Text2"

Code:
ActiveDocument.Unprotect
ActiveDocument.FormFields("Text2").Range.Select
    Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
        "INCLUDEPICTURE  ""d:\\gerry\\excelle.jpg"" ", PreserveFormatting:=True
    ActiveWindow.View.ShowFieldCodes = Not ActiveWindow.View.ShowFieldCodes
ActiveDocument.Protect (wdAllowOnlyFormFields), Password:=""

Remember a formfield is, by nature, protected for forms. So, regardless you MUST unprotect IF you are inserting an image INTO a formfield.

If you inserting a images that is NOT in a formfield (or a section protected for forms), then by all means you can do what ever you want. Again, use continuous sections.

You can also just cut and paste an image from somewhere else into a formfield. Simply copy/cut the image, and with the document UNPROTECTED, paste it into the formfield.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top