Problems with inline shapes

Y

Yeager

I'm using the following little snippet of code to resize
all of the inline shapes in my document:

Dim objDoc As Document
Dim oPic As InlineShape

Set objDoc = ActiveDocument
For Each oPic In objDoc.InlineShapes

oPic.LockAspectRatio = msoFalse
oPic.Height = 23
oPic.Width = 62

Next oPic

However, I'm not having any luck KEEPING the pics
resized. If I save the document and then open it again,
it as if I never resized the pics at all. I poked around
the MVP FAQ and the knowledge base and found some things
that resembled this problem, but they say that it was a
bug in Word 97. I'm running 2000. Any idea what I'm
doing wrong here? How do I force Word to remember the
changes I made to the shape?

-Yeager
 
Y

Yeager

Some clarification:

If I uncheck the box "Relative to original picture size"
when formatting the picture, this seems to solve the
problem. I don't know how to get to this property of the
pic through VBA, and I'm not entirely clear on why this
solves the problem either.

-Yeager
 
C

Cindy M -WordMVP-

Hi Yeager,

Press Alt+F9 to view the field codes for these linked
pictures? Is there some kind of \* MergeFormat switch in
there? And if you remove it from one or two fields do they
retain the formatting changes?

Or, if there's no switch, if you add it to a couple of
fields, do these work correctly?

(Obviously, I'm vaguely remembering something and can't quite
pin it down...)
If I uncheck the box "Relative to original picture size"
when formatting the picture, this seems to solve the
problem. I don't know how to get to this property of the
pic through VBA, and I'm not entirely clear on why this
solves the problem either.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)
 
W

Word Heretic

G'day Cindy M -WordMVP- <[email protected]>,

Unfort Word gets RIGHT in our face with this stuff sweetie. I have
played a LOT with these scenarios. What we get is a few basic
variations on a theme - nasty but hey.

When you insert a graphic Word don't know how to deal with it. So it
calls a sys rout to do some stuff. One of those things is pass back an
X x Y. Word uses this to make a dumb assed render frame for a totally
sep pass of a render engine (heavily patched now with effective layers
- badly implemented) to again call some foreign rout to fill the
frame. This gets saved on top of all the stuff mentioned in <that good
gfx kb in my spellbook>.

So, Word 'incorrectly' renders our actual object based on its previous
settings. This plays havoc with scale and width settings on a VBA
readable level. Unless we call sys routs ourselves to satisfy the
96dpi conversion that is mandatory, and then RESET the frame (del and
re-insert in MY books, but I'm a heretic n all) we CANNOT truly know
what is where and how.

Word dont know gfx. QED.




Cindy M -WordMVP- said:
Hi Yeager,

Press Alt+F9 to view the field codes for these linked
pictures? Is there some kind of \* MergeFormat switch in
there? And if you remove it from one or two fields do they
retain the formatting changes?

Or, if there's no switch, if you add it to a couple of
fields, do these work correctly?

(Obviously, I'm vaguely remembering something and can't quite
pin it down...)


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
wordheretic.com

If my answers r 2 terse, ask again or hassle an MVP,
at least they get recognition for it then.
Lengthy replies offlist require payment.
 
Y

Yeager

Woah. Okay, so does that mean that the only way to "fix"
this mess is to delete all of the pics and reinsert them,
THEN run the macro to resize them so the "scaling" that
Word is trying to do doesn't screw it up? Help me out
here.

-Yeager
 
C

Cindy M -WordMVP-

Hey Steve,
Word dont know gfx. QED.
I don't disagree with that :) However, that doesn't solve
Yeager's problem.

There are a couple of issues with \* MergeFormat and \*
MergeformatINET - especially the latter! - and I'm trying
to find out what might be applicable in his case. If he
does have that INET thing, then it probably possible to
settle things down in his documents...

BTW and OT: I haven't forgotten / missed the reproduction
thing you posted a few weeks ago. It's still bookmarked for
me, I just never seem to catch up enough to get around to
it. But I promise I will!

Cindy
 
W

Word Heretic

G'day "Yeager" <[email protected]>,

that is indeed EXACTLY what I do Yeager. Take the range of the picture
and store it before deleting it. I always collapse that range to use
for the re-insert point.

This is mainly a problem for gfx that get resized outside of Word with
an art package. Annoying as all buggery to say the least.



Woah. Okay, so does that mean that the only way to "fix"
this mess is to delete all of the pics and reinsert them,
THEN run the macro to resize them so the "scaling" that
Word is trying to do doesn't screw it up? Help me out
here.

-Yeager

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
wordheretic.com

If my answers r 2 terse, ask again or hassle an MVP,
at least they get recognition for it then.
Lengthy replies offlist require payment.
 
W

Word Heretic

G'day Cindy M -WordMVP- <[email protected]>,

<Shrugs> I dunno, it solved mine.

Re BTW and OT: LOL - I know EXACTLY what you mean.



Cindy M -WordMVP- said:
Hey Steve,

I don't disagree with that :) However, that doesn't solve
Yeager's problem.

There are a couple of issues with \* MergeFormat and \*
MergeformatINET - especially the latter! - and I'm trying
to find out what might be applicable in his case. If he
does have that INET thing, then it probably possible to
settle things down in his documents...

BTW and OT: I haven't forgotten / missed the reproduction
thing you posted a few weeks ago. It's still bookmarked for
me, I just never seem to catch up enough to get around to
it. But I promise I will!

Cindy

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
wordheretic.com

If my answers r 2 terse, ask again or hassle an MVP,
at least they get recognition for it then.
Lengthy replies offlist require payment.
 

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