It might be
AxDrawingControl1.Window.Application.DoCmd(1669) or
AxDrawingControl1.Document.Application.DoCmd(1669)
Hi June,
Thanks for ur reply,But unfortunately I am getting same error for both
statements.
Please find my code I think it will help u understand
internal static bool
GenerateDrawing(AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl
drawingControl1,
VisioComponent.ShapeInfoStruct[] shapeinfo,
VisioComponent.ConnectionInfoStruct[] connectioninfo, string
_DocumentStensilPath)
{
bool result = false;
try
{
if (drawingcontrol != null)
drawingcontrol = null;
if (shapeArray!= null)
shapeArray = null;
if (connectionArray != null)
connectionArray = null;
drawingcontrol = drawingControl1;
Visio.Document newDocument = null;
drawingControl1.Src = _DocumentStensilPath;
drawingControl1.Document.Application.DoCmd(1669);
//DocumentStensil = _DocumentStensilPath;
newDocument = drawingControl1.Document;
drawingControl1.Window.ShowGrid = 0;
drawingControl1.Window.ShowRulers = 0;
drawingControl1.Window.ShowScrollBars = 0;
drawingControl1.Window.ShowPageTabs = false;
drawingControl1.Window.Zoom = 0.7;
//drawingControl1.Window.BackgroundColor = vbWhite;
///////Close Shapes Window///
Visio.Application myapplication=
drawingControl1.Window.Application;
//myapplication.DoCmd(Visio.);
Visio.Documents mydocuments = myapplication.Documents;
Visio.Windows mywindows =
myapplication.Windows[1].Windows;
Visio.Window window = null;
short numwindows = mywindows.Count;
for (short i = 1; i <= numwindows; i++)
{
window = mywindows
;
window.Visible = false;
}
//drawingControl1.Window.Application.DoCmd(1669);
drawingControl1.Window.ZoomBehavior =
Visio.VisZoomBehavior.visZoomVisioExact;
drawingControl1.Window.Windows.get_ItemFromID((int)Visio.VisWinTypes.visWinIDPanZoom).Visible
= true; ;
//
myapplication.DoCmd((short)Microsoft.Office.Interop.Visio.Vis.visCmdShapesWindow);
drawingControl1.PageSizingBehavior =
Visio.VisPageSizingBehaviors.visResizePages;
//
newDocument.Application.Window.Windows.get_ItemFromID(1669).Visible =
false;
// ///////////Set the Array information////////
shapeArray = shapeinfo;
connectionArray = connectioninfo;
if (newDocument != null)
{
result = buildVisioDrawing(newDocument);
}
drawingControl1.Window.BackgroundColor =
(uint)System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.White);
drawingControl1.Window.BackgroundColorGradient =
(uint)System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.White);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
return result;
}
Shail