- UID
- 337772
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2005-10-17
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
我什么这段循环打印的vba程序在2002中可以使用
而在2005中只能打出一张就报错????
很不解,虚心请教
以下是源码:
Sub 批量打印()
Dim x As Integer
Dim i As Integer
Dim length As Double
Dim point1 As Variant, point2 As Variant
Dim point3 As Variant
Dim Message, Title, Default, MyValue
point1 = ThisDrawing.Utility.GetPoint(, "请输入左下角点:")
ReDim Preserve point1(0 To 1)
point2 = ThisDrawing.Utility.GetPoint(, "请输入右上角点:")
ReDim Preserve point2(0 To 1)
point3 = ThisDrawing.Utility.GetPoint(, "输入第二张图纸左下角点:")
ReDim Preserve point3(0 To 1)
length = point3(0) - point1(0)
Message = " 输入打印多少张? "
Title = "提醒:"
Default = "1"
x = InputBox(Message, Title, Default)
For i = 1 To x Step 1
ThisDrawing.ActiveLayout.SetWindowToPlot point1, point2
ThisDrawing.ActiveLayout.GetWindowToPlot point1, point2
ThisDrawing.ActiveLayout.PlotType = acWindow
ThisDrawing.Plot.PlotToDevice '用默认设置打印到打印机
point1(0) = point1(0) + length: point1(1) = point1(1)
point2(0) = point2(0) + length: point2(1) = point2(1)
Next i
End Sub |
|