"Requested operation is presently disabled" When Setting Shape's Text

Started by alexis_salinas, September 25, 2008, 11:01:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

alexis_salinas

Hi guy, i need help with this


Const TemplateName = "UMLMOD_U.VST"
Const StencilName = "UMLSEQ_M.VSS"
vApp = New Visio.Application()
vDoc = vApp.Documents.Add(TemplateName)
vStencil = vApp.Documents.OpenEx(StencilName, 4)
vConnectorMaster = vStencil.Masters("Message")
vConnector = vApp.ActivePage.Drop(vConnectorMaster, 1, 1)

vConnector.Text="My Message"


The last line:

vConnector.Text="My Message" -->throws exception "Requested operation is presently disabled"


thanks guy



Paul Herber

The UML message shape's text is protected, it can only be set using the supplied interfaces. However, if you wish to override this setting you could turn off the shape's text protection, then write your own text.
The rest of any model may break though. It's a closed interface.

Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

prlarry

Hello,

I know this is an old topic but this is the closest solution I could find to my particular problem.  With C# I have successfully dropped a "class" shape on the page, and changed the "attribute" text of the shape.  Visually everything is as I would like it.  However, If I view the properties through the Visio UI, the Attributes and Operations are not present.  So the shape text is present but there are no sub shapes representing the text I guess.

Can someone, give me some simple code (C# or VB) that would add/drop/insert sub shapes into the Shapes property of the parent shape?  Pointing me to the correct post would be fine as well.  Any help would be appreciated, I have scoured the internet trying to find this solution.

Thank you.