明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1552|回复: 2

ActiveLayout.StyleSheet

[复制链接]
发表于 2006-4-13 09:27:00 | 显示全部楼层 |阅读模式

ThisDrawing.ActiveLayout.StyleSheet = "monochrome.ctb"

为什么出错?

 楼主| 发表于 2006-4-13 13:20:00 | 显示全部楼层

Public Sub printdoc()
Dim point1(100) As Variant
Dim point2 As Variant, point3 As Variant, point4(0 To 1) As Variant
Dim keywordList As String
On Error Resume Next
With ThisDrawing.ActiveLayout
.StyleSheet = "monochrome.ctb"
.CenterPlot = True
.PlotRotation = ac90degrees
.PaperUnits = acMillimeters
.CanonicalMediaName = "A4"
.ConfigName = "HP LaserJet 5100 Series"
End With
point2 = ThisDrawing.Utility.GetPoint(, vbLf & "请点击打印区域的左下角:")
i = 0
Do While i < 1
  point1(i) = point2
  If Err.Number = -2147352567 Or Err.Number = 13 Then
  Exit Sub
   End If
    point2 = ThisDrawing.Utility.GetPoint(, vbLf & "请点击打印区域的右上角:")
 If (Int(point1(i)(1)) <> Int(point2(1))) Then
  i = i + 1
  point1(i) = point2
  End If
Loop
Number = ThisDrawing.Utility.GetInteger("Enter an number of the pages: ")
point2 = point1(0)
point3 = point1(1)
ReDim Preserve point2(0 To 1)
ReDim Preserve point3(0 To 1)
For j = 0 To Number - 1
point2(0) = point2(0) + (point3(0) - point2(0)) * j
point3(0) = point3(0) + (point3(0) - point2(0)) * j
ThisDrawing.ActiveLayout.CenterPlot = True
ThisDrawing.ActiveLayout.SetWindowToPlot point2, point3
ThisDrawing.Plot.NumberOfCopies = 1
ThisDrawing.ActiveLayout.PlotType = acWindow
ThisDrawing.Plot.DisplayPlotPreview acFullPreview
Next j
End Sub

为什么不能居中打印,还要设什么?

 楼主| 发表于 2006-4-13 13:30:00 | 显示全部楼层

问题解决了

 

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-27 04:12 , Processed in 0.201294 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表