object.SetWindowToPlot(LowerLeft, UpperRight)
Object
,
The object or objects this method applies to.
LowerLeft
Variant (two-element array of doubles); input-only
The X and Y values for the lower-left window.
UpperRight
Variant (two-element array of doubles); input-only
The X and Y values for the upper-right window.
Private Sub CommandButton1_Click()
ThisDrawing.PaperSpace.Layout.ConfigName = "hp laserjet 1000"
' 到布局
If ThisDrawing.ActiveSpace = acModelSpace Then
ThisDrawing.ActiveSpace = acPaperSpace
ThisDrawing.MSpace = False
ZoomExtents
End If
'打印落在选定空间内的全部内容
ThisDrawing.PaperSpace.Layout.PlotType = acExtents
'设计为草图打印,不计比例
ThisDrawing.PaperSpace.Layout.StandardScale = acScaleToFit
' 设置打印份数为1
ThisDrawing.Plot.NumberOfCopies = a
' 开始打印
ThisDrawing.Plot.PlotToDevice
Unload UserForm8
' 到模型
If ThisDrawing.ActiveSpace = acPaperSpace Then
ThisDrawing.MSpace = True
ThisDrawing.ActiveSpace = acModelSpace
End If
End Sub