乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 16|回复: 0

菜鸟请大家帮忙解决个vba打印的问题

[复制链接]

1

主题

2

帖子

2

银币

初来乍到

Rank: 1

铜币
6
发表于 2010-6-2 23:45:00 | 显示全部楼层 |阅读模式
这个是vba的一个实例,但是我在打印预览的时候看不到任何东西!
Sub Example_GetWindowToPlot()
    ' This example allows the user to define an area in the current layout to plot
    ' and displays a plot preview of the defined area.
    '
    ' * Note: You will have to exit the
    ' plot preview before the VBA example will stop and control will be returned
   
    Dim point1 As Variant, point2 As Variant
   
    ' Get first point in window
    point1 = ThisDrawing.Utility.GetPoint(, "Click the lower-left of the window to plot.")
    ReDim Preserve point1(0 To 1)   ' Change this to a 2D array by removing the Z position
   
    ' Get second point in window
    point2 = ThisDrawing.Utility.GetPoint(, "Click the upper-right of the window to plot.")
    ReDim Preserve point2(0 To 1)   ' Change this to a 2D array by removing the Z position
   
    ' Send information about window to current layout
    ThisDrawing.ActiveLayout.SetWindowToPlot point1, point2
   
    ' Read back window information
    ThisDrawing.ActiveLayout.GetWindowToPlot point1, point2
   
    MsgBox "Press any key to plot the following window:" & vbCrLf & vbCrLf & _
           "Lower Left: " & point1(0) & ", " & point1(1) & vbCrLf & _
           "Upper Right: " & point2(0) & ", " & point2(1)
   
    ' Make sure the instruction is to plot a view, not some other plot style
    ThisDrawing.ActiveLayout.PlotType = acWindow
   
    ' Send Plot To Window
    ThisDrawing.Plot.DisplayPlotPreview acFullPreview
End Sub
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-7-1 14:54 , Processed in 1.203541 second(s), 54 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表