L
Larry F.
I've got a Visio 2003 ActiveX control in a Visual Studio 2003 .Net
form. The trouble I'm having is that I can't seem to select shapes
that I have just drawn.
Here's my C# code:
using Visio = Microsoft.Office.Interop.Visio;
....
Visio.Page Page = /* initialized to a valid page */
Visio.Shape shape;
for (int i = 1; i <= 5; i++) {
shape = Page.DrawRectangle(i, 2, i+1, 3);
shape.Text = i.ToString();
shape.Name = "Number " + i;
}
Page.Application.Window.DeselectAll();
shape = Page.Shapes["Number 3"];
Page.Application.Window.Select(shape,
(short)Visio.VisSelectArgs.visSelect);
I get a COM exception "Requested operation is presently disabled" on
the call to Select(). The shapes draw just fine if I leave out the
Select().
Is there something I need to do to make Visio finish creating the new
shapes before I can select them?
Thank you for any suggestions you can give me.
form. The trouble I'm having is that I can't seem to select shapes
that I have just drawn.
Here's my C# code:
using Visio = Microsoft.Office.Interop.Visio;
....
Visio.Page Page = /* initialized to a valid page */
Visio.Shape shape;
for (int i = 1; i <= 5; i++) {
shape = Page.DrawRectangle(i, 2, i+1, 3);
shape.Text = i.ToString();
shape.Name = "Number " + i;
}
Page.Application.Window.DeselectAll();
shape = Page.Shapes["Number 3"];
Page.Application.Window.Select(shape,
(short)Visio.VisSelectArgs.visSelect);
I get a COM exception "Requested operation is presently disabled" on
the call to Select(). The shapes draw just fine if I leave out the
Select().
Is there something I need to do to make Visio finish creating the new
shapes before I can select them?
Thank you for any suggestions you can give me.