Quantcast
Channel: Word for Developers forum
Viewing all articles
Browse latest Browse all 4350

Using Array() function with Shapes..Select

$
0
0

I' am trying to dynamically select some shapes.

I have some code that works well to yield a string that is made up of the Index of the shapes I want to select.  

Normally, to select several shapes at once by using their Index number you can do:

ActiveDocument.Shapes.Range(Array(21, 22, 63, 64)).Select

As I said, the codes yields a string as follows:

ArrList = "21,22,63,64"

I am trying to use ArrList with the Array function and I cannot get it to work.

This works:

Dim A As Variant
A = Array(21, 22, 63, 64)

ActiveDocument.Shapes.Range(A).Select

But this does not:

Dim A As Variant
A = Array(Split(ArrList, ","))

ActiveDocument.Shapes.Range(A).Select

I get an Invalid Procedure or Call error.

Maybe it has to do with the fact that 

A = Array(Split(ArrList, ","))

seems to yield a two dimensional array instead of the uni-dimensional array that is needed.

How can I get "ArrList" to provide the Index number to Array() so that I can select just those shapes?

Thank you.


Viewing all articles
Browse latest Browse all 4350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>