How do I remove shape protection at runtime (c#)

O

Omri Shaked

I have a lot of shapes which I protect so the user won't be able to remove
them by pressing the DELETE button.

However, I do want to be able to remove them programatically. When I try
that, I obviously get a Protection exception.

Any ideas ? If there's another way of proventing the user from deleting the
object without protecting it, good as well.
 
C

Chris Roth [MVP]

Hi Omri,

I probably have the underscores in the wrong place, but you get the idea...

if( visShp.get_CellsU("LockDelete").get_ResultIU == 1 )
{
visShp.get_CellsU("LockDelete").get_ResultIU = 0;
}

// ...delete shape

--
Hope this helps,

Chris Roth
Visio MVP

More Visio shapes, articles, development info and pure diagramming fun at:
www.wanderkind.com/visio
 

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

Top