I'm trying to find out how to open Viewer window (menu Windows->Viewer in ArcMap) programmatically and zoom it to a specific location. This is how I can open it:
IDataWindowFactory dwf = new MapViewerWindowFactoryClass(); IDataWindow dw = dwf.Create(mArcMap); // typeof mArcMap is IApplication
and to show it:
but I can't find a way to set the initial extent when opening the viewer window or at least how to change it after it is loaded.
Problem solved by using IMapInsetWindow interface.
IDataWindow2 dw = this.createDataWindow(new MapViewerWindowFactoryClass()); IMapInsetWindow mapInset = dw as IMapInsetWindow; mapInset.MapInset.VisibleBounds = extent; dw.Show(true);