Public Sub Plot()
Dim point1(), point2()
ReDim Preserve point1(0 To 1) ReDim Preserve point2(0 To 1)
point1(0) = 0: point1(1) = 0 point2(0) = 420: point2(1) = 297 '指定打印机 ThisDrawing.ModelSpace.Layout.ConfigName = "HP LaserJet 5100 PCL 6" '指定纸张 ThisDrawing.ModelSpace.Layout.CanonicalMediaName = "A3" '指定打印样式 ThisDrawing.ModelSpace.Layout.StyleSheet = "acad.ctb" '指定打印范围 ThisDrawing.ModelSpace.Layout.SetWindowToPlot point1, point2 '接收打印范围 ThisDrawing.ModelSpace.Layout.GetWindowToPlot point1, point2 '指定为窗口打印 ThisDrawing.ModelSpace.Layout.PlotType = acWindow ThisDrawing.Plot.PlotToDevice
End Sub 我编的打印程序,可每次运行到
'指定打印范围 ThisDrawing.ModelSpace.Layout.SetWindowToPlot point1, point2 就出错了,麻烦您帮看看是怎么回事?
谢谢了!
我是刚学的,程序很菜,请多指教! |