我从未尝试过从Access打印,但这就是我从AutoCAD
- Public Sub StandardsPDF()
- Dim Layout As AcadLayout, strfile As String
- strfile = ThisDrawing.Path & "" & (Left(ThisDrawing.Name, (Len(ThisDrawing.Name)) - 4)) & ".pdf"
- Set Layout = ThisDrawing.ActiveLayout
- Layout.RefreshPlotDeviceInfo
- Layout.ConfigName = "HPDSH"
- Layout.PLOTTYPE = acExtents
- Layout.PlotRotation = ac0degrees 'Rotate to 90 for long sheets
- Layout.StyleSheet = "STANDARDS.ctb"
- 'Layout.CanonicalMediaName = "Tabloid"
- Layout.CanonicalMediaName = "Letter"
- Layout.PaperUnits = acInches
- Layout.StandardScale = ac1_1
- 'Layout.StandardScale = acScaleToFit
- Layout.ShowPlotStyles = False
- ThisDrawing.Plot.NumberOfCopies = 1
- Layout.CenterPlot = True
- Layout.RefreshPlotDeviceInfo
- ThisDrawing.Plot.PlotToDevice
- 'ThisDrawing.Plot.PlotToFile strfile
- Set Layout = Nothing
- ThisDrawing.Close (True)
- End Sub
打印的方式 |