....................... ThisDocument .................... Dim arcmap As New Class_Arcmap Private Const PREVIEW_FILENAME = "c:\temp\PreviewMap.jpg" '======================================================= ' PrintPreview '======================================================= Public Sub PrintPreview() arcmap.ExportToJeg f001_PrintPreview.Image1.height, f001_PrintPreview.Image1.width, PREVIEW_FILENAME Load f001_PrintPreview f001_PrintPreview.Image1.Picture = LoadPicture(PREVIEW_FILENAME) f001_PrintPreview.Show End Sub ................. f001_PrintPreview .................... '======================================================= ' CloseButton_Click '======================================================= Private Sub CloseButton_Click() Me.Hide End Sub .................... Class_ArcMap ...................... '======================================================= ' ExportToJpeg '======================================================= Public Sub ExportToJeg(height, width, filename) Dim exportRECT As tagRECT Dim hDC As Long Dim scl, scalex, scaley Set this.A.IActiveView = this.A.IMxDocument.ActiveView Set this.A.IExport = New ExportJPEG this.A.IExport.ExportFileName = filename this.A.IExport.Resolution = 96 scalex = width / this.A.IActiveView.ScreenDisplay.ClipEnvelope.width scaley = height / this.A.IActiveView.ScreenDisplay.ClipEnvelope.height scl = scalex If (scaley > scl) Then scl = scaley exportRECT.Left = 0 exportRECT.Top = 0 exportRECT.Right = this.A.IActiveView.ScreenDisplay.ClipEnvelope.width * scl exportRECT.bottom = this.A.IActiveView.ScreenDisplay.ClipEnvelope.height * scl Set this.A.IEnvelope = New Envelope this.A.IEnvelope.PutCoords exportRECT.Left, exportRECT.Top, exportRECT.Right, exportRECT.bottom this.A.IExport.PixelBounds = this.A.IEnvelope hDC = this.A.IExport.StartExporting this.A.IActiveView.Output hDC, this.A.IExport.Resolution, exportRECT, Nothing, Nothing this.A.IExport.FinishExporting this.A.IExport.Cleanup End Sub