houlinbo 发表于 2005-2-24 12:03:00

VBA中范围打印命令是什么?

VBA中有显示打印、根据图纸大小打印等,VBA中范围打印命令是什么?

PS122 发表于 2005-2-24 12:40:00

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.

houlinbo 发表于 2005-2-24 20:54:00

可以加上注释吗?

houlinbo 发表于 2005-2-24 20:56:00

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

houlinbo 发表于 2005-2-25 21:25:00

如4楼程序所示,是我编的一个程序,启动CAD后,用程序画的第一个图,可以全图打印,删除此图,再次用程序划图,再次打印时,总是不能全图打印,是否如下语名有问题?       
'打印落在选定空间内的全部内容
ThisDrawing.PaperSpace.Layout.PlotType = acExtents
页: [1]
查看完整版本: VBA中范围打印命令是什么?