macros

  • Thread starter Frustrated Frame User
  • Start date
F

Frustrated Frame User

How can I create a macro that recursively searches a document and resizes
graphics to a specific value?
 
J

Jonathan West

Frustrated Frame User said:
How can I create a macro that recursively searches a document and resizes
graphics to a specific value?

need more information.

Are the graphics "floating" or "inline"

Do you want them all resized to the same width, the same height, or some
percentage of their current size?


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
E

Ed

One way would be to record a macro doing the resize on one graphic, then
loop that code through the whole document. A couple of things to consider:
-- Are all of these graphics the same thing? Or a mixture of photos,
charts, metafiles, etc? That can make a difference on how VBA has to
"touch" the graphic to work with it.
-- Is there a way to use a graphics editor program to do this outside of
Word? Any time you touch a graphic in Word, the program stores a lot of
metadata, and sometimes two or more versions of the graphic, depending on
what it is and what you've done to it. This can bloat your document to
incredible size!

HTH
Ed
 
F

Frustrated Frame User

Jonathan,

All the graphics are inline, assigned to a custom paragraph style and i want
to resize them by a percentage of the current size.
 
J

Jezebel

Dim pShape as Word.InlineShape

For each pShape in ActiveDocument.InlineShapes
with pShape
.Width = .Width * FACTOR
.Height = .Height * FACTOR
end with
Next
 
R

Robert Werner

Is the p in pShape an arbitrary character or is this specifically defined in
VB?
 
J

Jezebel

pShape is an arbitrary variable name. InlineShape is an object in the Word
object model.
 
J

Jezebel

This is VBA not VB scripting. The books I've looked at all seemed much the
same to me.
 

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