Resize images in a word document

G

Gazza

Hello,

I have a word document with a number of .RLE files already inserted
from an oscilloscope that I would like to resize. Can anybody please
give me some code that I could use that would cycle round the images
one by one and reduce them to 50% of their starting size?

Many thanks in advance.

Gary
 
G

GeorgeW

simplist way

For i = 1 To ActiveDocument.InlineShapes.Count
ActiveDocument.InlineShapes(i).Height =
ActiveDocument.InlineShapes(i).Height / 2
ActiveDocument.InlineShapes(i).width =
ActiveDocument.InlineShapes(i).width / 2
Next
 
G

Gazza

simplist way

For i = 1 To ActiveDocument.InlineShapes.Count
ActiveDocument.InlineShapes(i).Height =
ActiveDocument.InlineShapes(i).Height / 2
ActiveDocument.InlineShapes(i).width =
ActiveDocument.InlineShapes(i).width / 2
Next

Thanks for the reply I will try that today. Are InlineShapes all the
objects in the document or just pictures?

Many thanks.

Gary
 
E

Ed

Hi Gary,

This is from Word 2003's VBA help.

InLineShape ...

Represents an object in the text layer of a document. An inline shape can
only be a picture, an OLE object, or an ActiveX control. InlineShape objects
are treated like characters and are positioned as characters within a line of
text. The InlineShape object is a member of the InlineShapes collection. The
InlineShapes collection contains all the shapes in a document, range, or
selection.

Shape...

Represents an object in the drawing layer, such as an AutoShape, freeform,
OLE object, ActiveX control, or picture. The Shape object is a member of the
Shapes collection, which includes all the shapes in the main story of a
document or in all the headers and footers of a document.

A shape is always attached to an anchoring range. You can position the shape
anywhere on the page that contains the anchor.

Note There are three objects that represent shapes: the Shapes collection,
which represents all the shapes on a document; the ShapeRange collection,
which represents a specified subset of the shapes on a document (for example,
a ShapeRange object could represent shapes one and four on the document, or
it could represent all the selected shapes on the document); the Shape
object, which represents a single shape on a document. If you want to work
with several shape at the same time or with shapes within the selection, use
a ShapeRange collection.

Regards.

Ed
 

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