How to Select OLEs and why does Selection.Cut & Paste resizes OLE?

J

Joe HM

Hello -

I have a Word Table that contains an OLE. The program that generated
that Word document did not resize the OLE so I can only see parts of it
in that cell.

I selected the OLE and ran a simple Selection.Cut and then
Selection.Paste macro which resized the OLE as desired. How does this
work? Why does Word resize the OLE? Does it do some PasteSpecial even
though I did not specify anything?

How can I write a macro that does this to all the OLEs in that table -
i.e. how can I Select the OLEs? I tried to get a handle on them via
Shapes but Shapes is empty for that document. So where are the OLEs
stored?

Thanks!
Joe
 
J

Jezebel

OLE is a method, not a thing. (Damn those acronyms!) So the discussion
hinges on what the object actually is -- some are resizable automatically or
otherwise, some are not.

However, the short answer is that Word, when it pastes an object, sizes it
to fit its container, if that is smaller than the object's original size.
The container being whatever you're pasting it into -- usually the text
boundaries of the page, or a table cell.

Looking at the Shapes collection is a good start: if this is empty your
objects are inline, so check the InlineShapes collection. In both cases, the
collection may contain objects other than those inserted by OLE, so you need
to check the type before doing any manipulation.
 
J

Joe HM

Hello -

Makes sense that it is a method. Thanks so much for you help! D'oh...
I could have realized that they are Inline because they are in a table
cell and not floating.

Thanks again,
Joe
 

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