Consulting

Results 1 to 10 of 10

Thread: Solved: Word 2003 Shapes/Array Issue

  1. #1
    Site Admin
    The Princess
    VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location

    Solved: Word 2003 Shapes/Array Issue

    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?
    ~Anne Troy

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    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.

  3. #3
    VBAX Regular Kelly's Avatar
    Joined
    Jun 2004
    Location
    Los Angeles, California
    Posts
    84
    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

  4. #4
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    Gimme some sample code to run, Kel, and I'll check it out.
    ~Anne Troy

  5. #5
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    Did you get any code?

  6. #6
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    I'm trying to get the user to come in and discuss the issue. Let's see what happens.
    ~Anne Troy

  7. #7
    VBAX Regular
    Joined
    Sep 2004
    Posts
    65
    Location
    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

  8. #8
    VBAX Regular
    Joined
    Sep 2004
    Posts
    65
    Location
    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?

  9. #9
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    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.

  10. #10
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    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>
    ~Anne Troy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •