View Single Post
Old 03-03-2004, 15:08
Alex's Avatar
Alex Alex is offline
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default Re: Debugging help required


There is an issue with using ShapeRange and Selection objects which do not properly update their bounding box (position/size). Well, it all results in that you need to explicitly create a selection out of shape range before you get or set its size/position.

In your particular case, you need to add "nsr.CreateSelection" right after you aquired it through ActiveSelectionRange.

The selection bounding box is updated when the obejcts are drawn on the screen, that's why you macro works correctly when you debug through it. The shapes have a chance to refresh themselves when you step through the code however they don't if you run the macro in a single shot.

Also it seems that BeginCommandGroup/EndCommandGroup screw up things badly for some reason. Disabling this makes the macro run correctly (after the CreateSelection hack). I'm not sure why this happens though.
Reply With Quote