How can I select graphics with keyboard shortcuts for macro use?

G

g

Here's my problem. I need to be able to create a macro that will find
all the graphics in a Word document and change their size to 5" wide.
I think I know how to do it, except that, at least in the documents I
need to do it on, there doesn't seem to be a way to select them
without the mouse.

I can use GoTo to put the cursor right before each graphic. I then
tried various combinations of arrow keys and SHIFT or CTRL without
luck. I can get the photo to reverse color, presumably suggesting that
its "position" has been selected in some way, but it doesn't allow me
to edit the image parameters.

I've been trying to do this in Word 97. The computer that this will
mostly be an issue on has Word 2003, I believe. Any ideas?

Greg Guarino

The Background:
I'm sure someone will wonder why I don't just do this manually. It's
actually a recurring situation. Our company's consultant produces
reports with photos practically daily, so I've set up macros to make
his life more efficient. One of them takes all the photos in a
directory an inserts them at the end of the document, spaced the way
he likes them and with a callout on each one. He has recently gotten a
different digital camera, and he likes to use the lowest resolution
for disk space efficiency. But the only "small" picture size on the
new camera yields the "wrong" photo size on the Word document, if he
does it on his laptop with Word 2003. On the desktop computer it works
as before. The photos look fine if I manually scale them, but he can't
stand chores like that. So I'm trying to put a "Scale Photos" macro
button on his laptop Word toolbar that will correct them all in one
stroke.
 
H

Harlan Grove

(e-mail address removed) wrote...
Here's my problem. I need to be able to create a macro that will find
all the graphics in a Word document and change their size to 5" wide.
I think I know how to do it, except that, at least in the documents I
need to do it on, there doesn't seem to be a way to select them
without the mouse.
....

Something like

Dim s As Shape
For Each s In ActiveDocument.Shapes
If s.Type = msoPicture Then
'your resizing statements here
End If
Next s

wouldn't work? Change the shape type constant from msoPicture to
whatever you need or add other types using Or, e.g.,

If s.Type = msoPicture Or s.Type = msoLinkedPicture Then

More fundamentally, ask application-specific questions in application-
specific newsgroups. This would be more appropriate for
microsoft.public.word.programming.
 

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