菜鸟请大家帮忙解决个vba打印的问题
<p>这个是vba的一个实例,但是我在打印预览的时候看不到任何东西!</p><p><font face="Verdana">Sub Example_GetWindowToPlot()<br/> ' This example allows the user to define an area in the current layout to plot<br/> ' and displays a plot preview of the defined area.<br/> '<br/> ' * Note: You will have to exit the<br/> ' plot preview before the VBA example will stop and control will be returned<br/> <br/> Dim point1 As Variant, point2 As Variant<br/> <br/> ' Get first point in window<br/> point1 = ThisDrawing.Utility.GetPoint(, "Click the lower-left of the window to plot.")<br/> ReDim Preserve point1(0 To 1) ' Change this to a 2D array by removing the Z position<br/> <br/> ' Get second point in window<br/> point2 = ThisDrawing.Utility.GetPoint(, "Click the upper-right of the window to plot.")<br/> ReDim Preserve point2(0 To 1) ' Change this to a 2D array by removing the Z position<br/> <br/> ' Send information about window to current layout<br/> ThisDrawing.ActiveLayout.SetWindowToPlot point1, point2<br/> <br/> ' Read back window information<br/> ThisDrawing.ActiveLayout.GetWindowToPlot point1, point2<br/> <br/> MsgBox "Press any key to plot the following window:" & vbCrLf & vbCrLf & _<br/> "Lower Left: " & point1(0) & ", " & point1(1) & vbCrLf & _<br/> "Upper Right: " & point2(0) & ", " & point2(1)<br/> <br/> ' Make sure the instruction is to plot a view, not some other plot style<br/> ThisDrawing.ActiveLayout.PlotType = acWindow<br/> <br/> ' Send Plot To Window<br/> ThisDrawing.Plot.DisplayPlotPreview acFullPreview<br/>End Sub<br/></font></p>
页:
[1]