Sub Export_Legend2EMF()
Dim pMxDoc As IMxDocument
Dim pActiveView As IActiveView
Dim pExport As IExport
Dim pPixelEnvelope As IEnvelope
Dim exportRECT As tagRECT
Dim iScreenResolution As Integer
Dim hDC As Long
Set pMxDoc = ThisDocument
Set pActiveView = pMxDoc.ActiveView
Set pExport = New ExportEMF
pExport.ExportFileName = "c:\exporttest10.emf"
iScreenResolution = 96
pExport.Resolution = iScreenResolution
exportRECT = pActiveView.ExportFrame
Set pPixelEnvelope = New Envelope
pPixelEnvelope.PutCoords exportRECT.Left, exportRECT.Top, exportRECT.Right, exportRECT.bottom
pExport.PixelBounds = pPixelEnvelope
hDC = pExport.StartExporting
Dim visibleEnvelope As IEnvelope
Set visibleEnvelope = New Envelope
visibleEnvelope.PutCoords 10, 10, 20, 20
pActiveView.Output hDC, pExport.Resolution, exportRECT, visibleEnvelope, Nothing
pExport.FinishExporting
pExport.Cleanup
End Sub
В этом случае получается, что кусочек лейаута размером 10х10 (visibleEnvelope) сохраняется в emf с размером всего лейаута. Очевидно, что кусочек лейаута 10х10 должен сохранятся как емф 10х10 (см).