Visio Guy

Solution-specific Visio Discussions => UML & Software Diagramming => Topic started by: civiccoupe on February 18, 2012, 10:21:53 AM

Title: use case can't add text
Post by: civiccoupe on February 18, 2012, 10:21:53 AM
Hi all,
I'm coding vb to call visio ; use case object but can't use like this

     vToShape.Text = "sample text"

(yes i know microsoft answer this problem in http://support.microsoft.com/kb/305343)
but it only config by manual
i want to config it by code or other way not a manual

Thank you
Title: Re: use case can't add text
Post by: Paul Herber on February 18, 2012, 11:39:28 AM
Is this the UML use case shape?
Title: Re: use case can't add text
Post by: civiccoupe on February 18, 2012, 11:48:04 AM
Yes Paul
- Use Case notation on UML use case Stencil
Title: Re: use case can't add text
Post by: civiccoupe on February 18, 2012, 12:46:59 PM
can VB config it by code or either way?
pls help
Title: Re: use case can't add text
Post by: civiccoupe on February 19, 2012, 01:41:45 AM
Finally i got it!!!
Example like this

Code
Dim vToShape as visio.shape


vToShape.CellsU("lockTextEdit").FormulaU = "0"
vToShape.Text = "sample text"

Insert  vToShape.CellsU("lockTextEdit").FormulaU = "0" before text you want to add.
when config it, You can add/edit text in protected shape.
Title: Re: use case can't add text
Post by: Paul Herber on February 20, 2012, 08:54:08 AM
Well, that might work, however, not recommended. Besides the fact that the UML addon will want to overwrite your text at some time, that shape is actually a grouped shape and it's not the top level shape that shoud hold the text, it's the sub-shape Object that should hold the text.