Clear Drawing Control

J

jpabich

I have two drawing controls on one page. One is visible, one is
hidden. I want to clear the hidden one. I use the following to clear
the visible one:

if ( VisPage.Shapes.Count > 0 )
{
VisWindow.SelectAll();
VisWindow.Delete();
}

If I try to define a second VisWindow, it errors and will not allow me
to continue. How can I clear this seconde window?
 
J

jpabich

Figured it out:

if ( VisPage2.Shapes.Count > 0 )
{
foreach (Visio.Shape visshape in VisPage2.Shapes)
{
visshape.Delete();
}
}
 

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