PowerPoint only selects the shapes that are completely covered within a
perimeter. Yu seem to want to change this behavior to also select the shapes
that are partially covered.
A couple of ways to go about it:
1. Perfect way:
Perfect ways are lot harder to implement at times but the end result is
quite satisfying. Here it goes:
It may not be a simple macro there. You can subclass the slide pane of the
active window. This will allow you to receive the mouse messages that arrive
for the slide pane. Handle the mousedown, mousemove and mouseup messages to
know the rectangular selection. Number of cases arise that need to be
handled. For instance, if Ctrl key is held when mousedown message was
received, then it means that the user wants to the new shape selection to
add to an existing selection. But if Ctrl is depressed before mouseup
message, then its a different behavior. A mousedown and a mouseup without a
mousemove would mean a mouse click and the code needs to handle that case as
well. Basically, you are on your own to provide proper semantics to all of
these cases and also provide proper feedback (like changing the mouse cursor
to include a plus sign when Ctrl is pressed) to the user on all of such
cases. I hope all this helps you understand the complexity of the task at
hand before you venture into it.
To start with, you need to know the slide pane to be able to subclass it.
All panes are of the window class called "paneClassDC". Get the handle to
the pane that matches the dimensions and location of the slide pane.
2. Probabilistic way:
This is not perfect and a different route may also end up with you selecting
other shapes. The basic idea is to look at the shapes that are in a
selection and determine if they got selected were because of a perimeter
selection. Try to determine the largest bounding rectangle that includes all
the selected shapes. If the shapes included within this rectangle are all
within the selected shapes collection, then there is a high probability that
the shapes were selected by perimeter selection. In such a case, include the
shapes that overlap this bounding rectangle. But make sure your code
understands that the new bounding rectangle that will get created because of
this activity is your doing and not the user's. Otherwise your code could
eventually end up always selecting all shapes on the slide.
- Chirag
PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html