Discussion:
How to update text within a shape when dragged into drawing
(too old to reply)
Nick
2009-07-20 15:48:02 UTC
Permalink
I've been playing around for a while, I would like to update the text
displayed when it is dragged over from the stencil.

I originally created this shape. The text within it is dynamic based upon
the textshape of other shapes on the first page of the drawing. But when I
add this shape to the stencil, all references are lost.

The next thing I tried to do was store the text I care about within the
document properties. That worked half way, now when I drag the shape onto the
drawing the text within it updates. However, the text I truly care about is
still contained within some shapes on the first page.

So I was hoping someone had ideas on how to get either approach I have tried
to work or if you have an alternate approach.

Approach 1: Shape dragged from stencil updates itself when added to a
drawing. The source text is the text within shapes. The references to these
shapes will be consistent since they are apart of a template in which the
stencil load.

Approach 2: Updating the text within a shape of interest updates the
document property description (for example) to have the same value.
Chris Roth [Visio MVP]
2009-08-03 15:26:07 UTC
Permalink
Hi Nick,

If the "shapes on the first page" are always there, then you should be
able to go with document ShapeSheet cells.

So on page 1 you've got, say Sheet.72 that has some important text.

A document ShapeSheet cell could get this text:

TheDoc...User.txt1 = ShapeText( Pages[Page-1]!Sheet.72!TheText )

Then you make a master (in the document stencil) that references this.
Perhaps by using Insert > Field and choosing "Custom":

= TheDoc.User.txt1

If the master is created locally in the document (in the Document
Stencil), then instances of the master should be able to pick up the
text from any page.

Theese articles might help as well:

What’s My Shape’s ID?
http://www.visguy.com/2009/07/15/whats-my-shapes-id/

Top 9 Reasons for Turning-on Developer Mode
http://www.visguy.com/2008/08/04/top-9-reasons-for-turning-on-developer-mode/

Top Twelve Text Tips
http://www.visguy.com/2009/05/06/top-twelve-text-tips/
--
Hope this helps,

Chris Roth
Visio MVP


Visio Guy: Smart Graphics for Visual People

Articles: http://www.visguy.com
Shapes: http://www.visguy.com/shapes
Dev: http://www.visguy.com/category/development/
Forum: http://www.viguy.com/vgforum
Post by Nick
I've been playing around for a while, I would like to update the text
displayed when it is dragged over from the stencil.
I originally created this shape. The text within it is dynamic based upon
the textshape of other shapes on the first page of the drawing. But when I
add this shape to the stencil, all references are lost.
The next thing I tried to do was store the text I care about within the
document properties. That worked half way, now when I drag the shape onto the
drawing the text within it updates. However, the text I truly care about is
still contained within some shapes on the first page.
So I was hoping someone had ideas on how to get either approach I have tried
to work or if you have an alternate approach.
Approach 1: Shape dragged from stencil updates itself when added to a
drawing. The source text is the text within shapes. The references to these
shapes will be consistent since they are apart of a template in which the
stencil load.
Approach 2: Updating the text within a shape of interest updates the
document property description (for example) to have the same value.
Loading...