yzbj1983 发表于 2005-8-17 22:44:00

明总求您帮忙看看,急!!!

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

王咣生 发表于 2005-8-17 23:31:00

reply

<P>Public Sub Plot1()</P>
<P>&nbsp;&nbsp;&nbsp; Dim point1(0 To 1) As Double<BR>&nbsp;&nbsp;&nbsp; Dim point2(0 To 1) As Double</P>
<P>&nbsp;&nbsp;&nbsp; point1(0) = 0: point1(1) = 0<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; point2(0) = 420: point2(1) = 297<BR>&nbsp;&nbsp;&nbsp; '指定打印机<BR>&nbsp;&nbsp;&nbsp; ThisDrawing.ModelSpace.Layout.ConfigName = "HP LaserJet 5100 PCL 6"<BR>&nbsp;&nbsp;&nbsp; '指定纸张<BR>&nbsp;&nbsp;&nbsp; ThisDrawing.ModelSpace.Layout.CanonicalMediaName = "A3"<BR>&nbsp;&nbsp;&nbsp; '指定打印样式<BR>&nbsp;&nbsp;&nbsp; ThisDrawing.ModelSpace.Layout.StyleSheet = "acad.ctb"<BR>&nbsp;&nbsp;&nbsp; '指定打印范围<BR>&nbsp;&nbsp;&nbsp; ThisDrawing.ModelSpace.Layout.SetWindowToPlot point1, point2<BR>&nbsp;&nbsp;&nbsp; '接收打印范围<BR>&nbsp;&nbsp;&nbsp; ThisDrawing.ModelSpace.Layout.GetWindowToPlot point1, point2<BR>&nbsp;&nbsp;&nbsp; '指定为窗口打印<BR>&nbsp;&nbsp;&nbsp; ThisDrawing.ModelSpace.Layout.PlotType = acWindow<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; ThisDrawing.Plot.PlotToDevice</P>
<P>End Sub</P>

yzbj1983 发表于 2005-8-18 12:45:00

<P>非常感谢王总!!!</P>
<P>小弟真是感激涕零啊!!!</P>
<P>再次跪谢!</P>
页: [1]
查看完整版本: 明总求您帮忙看看,急!!!