Document.Shape collection order in Doc vs Docx

F

Feederman

Hi Guys,
I have noticed a major diifference in the Word 2007 Object Model
behavior when loading an identical document in the old .Doc format
and the new .Docx format.

The order of Shapes in the Document.Shapes collection is as microsoft
say is:
"A shape's position in the z-order corresponds to the shape's index
number in the Shapes collection. For example, if there are four shapes
on myDocument, the expression myDocument.Shapes(1) returns the shape
at the back of the z-order, and the expression myDocument.Shapes(4)
returns the shape at the front of the z-order."

This is obviously the case for the old .doc format. But when loading
a .Docx document in word 2007, the order of the shapes in the array
differs from that in the identical document when converted back
to .Doc and loaded.

I have tested this many times with many different documents and the
order of the shapes in the Documents.Shapes property does not match
the zorder of the shapes in the document! Ie, the shape last in the
array, should be the topmost on screen and is not.

Am I being insanley stupid here and missing something, or have
microsoft just decided to change the order of the array for the
new .Docx format!

Just to note, I have also tried Document.Content.ShapeRange array, and
looked at the order in there, again it does not seem to be the zorder
in the document.

Anyone got any ideas on this one, im very lost? Thanks once again for
your help.

Simon Turner
 

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