'Selection'.Select problem

M

Mac

continuation to my previous request; after I've selected (manually) a shape
on my page, I run the following code:

Set slct = ActiveWindow.Selection 'get what is currently selected
....
Then I want to add other shapes to this selection, via:
Call slct.Select(remoteShp, visSelect) 'add remoteShp to current sel.

but: I'd have expected that remoteShp be added to slct's Item collection,
but in debug mode I can see that after the second call, slct contains
remotShp only, and the same happens with each consecutive call, i.e. the
selection holds the last shape added only. Why?
Moreover, even though there are diferent shapes in the selection, visually I
can still see the original shape selected, i.e. the one I selected manually
before running the code. I can't get the hang of how this works..where do I
go wrong? please help!
 
J

JuneTheSecond

Simply repeat ActiveWindow.select YourShape1, visSelect.
This would add selected shapes into ActiveWindow.Selection.
You can get final result by Set slct = ActiveWindow.Selection .
 
M

Mark Nelson [MS]

You mentioned working on parts of groups in your previous posts. You have
to pay attention to subselection and superselection when dealing with
groups. If you want to select a shape within a group, you need to use the
visSubSelect flag. Also some combinations of group shapes and subshapes
cannot be selected at the same time.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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