ConvertToShape in Word 2003

C

Charles Jacobus

I'm finding that in some documents in Word 2003 (5+ pages, especially
documents with tables) pictures (Shapes) aren't made visible after
converting them from inline shapes using the ConvertToShape function. This
only seems to be a problem in Word 2003; the same scenario in prior versions
of Word works fine.

If I manually refresh the Word document (e.g., switch views, Ctrl+Home and
Ctrl+End, etc.), then the picture becomes visible.

I've tried ScreenUpdating and ScreenRefresh with no luck, but any
suggestions are welcome.

Anyone else experience this? Any known solution/workaround.

Thanks.

Charles.

####################################

Code sample:
Set TheInlineShape =
m_WordApp.ActiveDocument.InlineShapes.AddPicture(ImageLoc, False, True,
m_WordApp.Selection.Range)
Set TheShape = TheInlineShape.ConvertToShape
TheShape.WrapFormat.Type = wdWrapNone
TheShape.Name = TICKMARK_NAME_PREFIX & ShapeID
TheShape.Visible = True
 
C

Charles Jacobus

A slight amendment here: The problem seems to occur only when inserting
pictures in large tables that happen to be in large documents.
 
P

Peter Hewett

Hi Charles

I don't have W2003 installed so I can't test for your problem. But as a
workaround try the following after you've converted the InlineShape:
Application.ScreenRefresh

HTH + Cheers - Peter
 
C

Charles Jacobus

Peter.

Thanks for the reply. I tried both ScreenRefresh and ScreenUpdating with no
luck.

However, I did find the root of the problem. Seems that in Word 2003, the
"Automatically resize to fit contents" (in VBA, the AllowAutoFit property)
must be set for screen refreshing to occur properly in a table. By this I
mean that in prior versions of Word, it was not required to have this set in
order for a shape to display in a table after calling ConvertToShape. In
Word 2003, it is required. Once this property is set in the table, the shape
shows up perfectly.

Charles.
 

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