Create a macro to set size of a picture to some default width andheight

B

BobRoyAce

I have a Word 2007 document that contains, among other things, two
pictures. The two pictures are located next to one another, about 1/4
inch apart. They are sized at 1.25" high by 1.87" wide. Now, the
pictures are there as placeholders really, as what we want to do is
select and copy two different images (one at a time) from another
program, and then paste them where the placeholders are. However, the
images that we are copying are very large (i.e. many inches high by
many inches wide), but we want them to end up being 1.25" by 1.87" as
mentioned prior.

We'd like to facilitate this in such a way so as to make it possible
for the user to not be required to actually format/size the pictures.
We'd like them to just have to click on a button, or press some key-
combination, to fire off some basic code to change the size of the
picture to the desired size.

Any ideas on some creative ways to accomplish something like this?
 
J

Jay Freedman

The simplest way to accomplish this is to insert a table with one row
and two columns. Click the Table Tools > Layout > Properties button.
On the Column tab of the dialog, set the column widths to 2". On the
Table tab, click the Options button; in that dialog, uncheck the
"Automatically resize" option and set the left and right cell margins
to 0.06". Click OK. On the Table Tools > Layout ribbon, click the
AutoFit button and choose Fixed Column Width. Finally, press
Alt+Ctrl+U to turn off the table borders.

Any picture inserted into one of this table's cells will automatically
be sized to 1.87" wide (I would have calculated 2" - 2 x 0.06" = 1.88"
but experiment shows that Word thinks it's 1.87"). Whether their
height is 1.25" depends on whether the original picture's aspect ratio
is the same as 1.25:1.87 -- or don't you care about preserving the
aspect ratio?

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top