Help with inline shapes

J

Jim

Hello,

I am trying to make a DOT file with a number of text boxes set up as
inlineshapes. I can get them in the document fine (names in property list
of TBox1, Tbox2 etc), and they work with the dblclick event just fine but I
can not refer to them outside of the doubleclick event sub as inlineshapes
"don't have names".

The textbox has a name (like TBox1) and I can refer to it's name, but when
I try to pass it to another sub to work on the text, it fails - generally
telling me that the (name) method/property isn't valid. I tried to refer
to the textbox with the index from the inlineshapes collection, but I can
not find out which index number corresponds to the textbox.


Any help/directions is appreciated.

Jim
 
J

Jonathan West

Jim said:
Hello,

I am trying to make a DOT file with a number of text boxes set up as
inlineshapes. I can get them in the document fine (names in property list
of TBox1, Tbox2 etc), and they work with the dblclick event just fine but
I
can not refer to them outside of the doubleclick event sub as inlineshapes
"don't have names".

The textbox has a name (like TBox1) and I can refer to it's name, but when
I try to pass it to another sub to work on the text, it fails - generally
telling me that the (name) method/property isn't valid. I tried to refer
to the textbox with the index from the inlineshapes collection, but I can
not find out which index number corresponds to the textbox.

The index number of any individual inlineshape is equal the number of
inlineshape in a Range that extends from the beginning of the document to
the position of the inlineshape under consideration. Therefore, if you have
the inlineshape selected, you can get the index number like this

InlineShapeIndex = ActiveDocument.Range(0, Selection.End).InlineShapes.Count

Or alternatively, you can in fact past the inlineshape object itself to a
subroutine as a paramater of type InlineShape.
 

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

Similar Threads


Top