
Taking Pictures from Word and Populating Imageboxes in a Userform
Thanks Doug for the tip. The method you provided works
great if you hard code both the file path and specific
graphic file into the VB code. However, I'm trying to
come up with code to automatically populate the Image
Control box with some "variable" graphics file shown in
the Word doc.
I tried playing around with the INCLUDEPICTURE field, but
I'm guessing that this field property only works if you
hard code the file path of the picture you want. Is there
a way, or some code using variables, to pick up the
picture from a Word doc by using some field property
and/or bookmarks?
My ultimate purpose is to be able to change the picture on
the UserForm, insert it back into a specific location on
the Word doc, and then update the same picture across
multiple document templates, i.e. changing the company
logo across multiple company document templates. Sorry
about this being so long-winded, but I'm really stuck.
Thanks.
Quote:
>-----Original Message-----
>Hi Simon,
>To load a picture into and image control on a userform,
use
>Image1.picture=LoadPicture("c:\windows\argyle.bmp")
>You should be able to get the path\filename of a picture
in an
>IncludePicture field in your document by parsing the code
of the field.
>Please post any response to the newsgroups for the
benefit of others who may
Quote:
>also be following the thread.
>Hope this helps,
>Doug Robbins - Word MVP
>> Hi All,
>> I am trying to take graphic files(i.e. *.bmp, *.jpg,
etc.)
>> from Word and populate image control boxes on a
UserForm.
>> As soon as the UserForm is activated, I want the
pictures
>> to automatically populate the image control boxes.
Then,
>> I want to have the option to replace the picture and put
>> it back into the Word document. I am doing this
through a
>> UserForm because I want to be able to edit and update
>> fields, including graphical objects/pictures like *.bmp
>> and *.jpg files, across multiple Word documents. When I
>> update the fields and/or change the picture, it should
>> update all documents with those fields.
>> In this case, would I use "IncludePicture" fields or
>> bookmarks as markers in the Word document? I found an
MVP
>> article re "Extracting a picture from an Image Control
in
>> a UserForm." However, I am still uncertain as to how I
>> can populate the Image Control in a UserForm. Any help
on
>> this would be greatly appreciated. Thanks.
>> Simon
>.