PDA

View Full Version : Solved: Word 2003 Shapes/Array Issue



Anne Troy
09-22-2004, 05:37 PM
Does anyone know anything about it?
Or a potential way to get around it?

A friend of mine is working on a project, and I offered y'all up to help her, but she said:


Unless you know someone who knows how to workaround the Word2003 bug with the Shape.Range property not accepting an array of shape names, I'm afraid there's not a lot anyone can do.
Can we help her?

Jacob Hilderbrand
09-22-2004, 05:47 PM
We could work with the shapes seperately instead of an array. I don't have 2003 so I am not sure.

Also check microsoft to see if there is a patch to fix the glitch.

And if she posts what she exactly wants to do someone may know another way to do what she wants.

Kelly
09-22-2004, 08:41 PM
No way!

you mean to tell me that a command like:

ActiveDocument.Shapes.Range(Array("Rectangle 3", "Oval 2")).Select

is totally ineffectual in Word 2003?

Pardon my French, but that really sucks.

I, like DRJ, do not have Word 2003 (yet), so I can't recreate this bug here at home.

I think the only "complete" workaround would be to create your own class module. In other words, create a MyVeryOwnShapeRange class and then create methods for it that would imitate the methods of the ShapeRange class.

It would be a major major pain in the butt, but depending on the particular project, it might actual be desireable or necessary.

However, Murphy's law dictates that the day after you finish creating your own shaperange class, you will immediately find a patch from Microsoft (as DRJ suggested) that will render all your hours of work for naught.

Kelly (http://kellyjones.netfirms.com/spanish/spanwelcome.html)

Anne Troy
09-22-2004, 08:52 PM
Gimme some sample code to run, Kel, and I'll check it out. :)

fumei
09-22-2004, 09:14 PM
Did you get any code?

Anne Troy
09-22-2004, 09:24 PM
I'm trying to get the user to come in and discuss the issue. Let's see what happens. :)

Bilby
09-22-2004, 09:42 PM
No, I run Word 2003 and just tried the following to be certain, and it worked justa lika ita shoulda.

ActiveDocument.Shapes.Range(Array("Picture 2", "Picture 3")).Select


Bilby

Bilby
09-22-2004, 09:50 PM
Just to add to my reply, in Word 2003 there's no problem. BUT, is your friend aware that the default inline shape has to be converted to Shapes, and that its Shapes.Range not Shape.Range?

fumei
09-23-2004, 02:01 AM
Could it have some thing to do with this, from MSDN:

If you use this property on a ShapeRange object that contains more than one shape, an error occurs.

This is the anchor property, The Shapes are anchored to a page (or more literally a paragraph. Does this make any sense - in terms of a problem.

Anne Troy
09-23-2004, 09:32 AM
Okay, thanks everybody! Appears it's resolved.


If anyone else at your end comes along complaining they can't assign an array of shape names to Shape.Range, tell them they have to declare the array as type VARIANT. Woulda been nice if the error message even hinted at that <sigh>