NguyenNgocSon 43 Báo cáo bài đăng Đã đăng Tháng 6 9, 2013 Xin hỏi các bác trong diển đàn Thủ thục Print preview khi in bằng VBA là gì ? Đoạn code dưới đây báo lỗi ? Public Sub PlotView() Dim intCount As Integer Dim strViewToPlot As String Dim objView As AcadView Dim strFilename As String strViewToPlot = InputBox("Enter name of view to plot: ", "Plot View") On Error Resume Next Set objView = ThisDrawing.Views(strViewToPlot) If objView Is Nothing Then MsgBox "This view does not exist" Exit Sub End If strFilename = InputBox("Enter a filename to plot to") If strFilename = "" Then Exit Sub 'set view to plot ThisDrawing.ModelSpace.Layout.ViewToPlot = strViewToPlot ThisDrawing.ModelSpace.Layout.PlotType = acView 'Initiate the plot ThisDrawing.Plot.PlotToFile strFilename End Sub Cám ơn! Chia sẻ bài đăng này Liên kết tới bài đăng Chia sẻ trên các trang web khác
Anlee 3 Báo cáo bài đăng Đã đăng Tháng 7 23, 2013 Review ThisDrawing.Plot.DisplayPlotPreview acFullPreview Print review Result =ThisDrawing.Plot .PlotToDevice(Layobj.ConfigName) Result as Boolean Layobj As AcadPlotConfiguration mình cũng mới tìm hiểu VBA và đã chạy thử đoạn code trên -Nó sẽ in 1 cái view ma mình đặt tên. Bạn thử dùng lệnh "V" sau đó đặt tên 1 view xem sao Chia sẻ bài đăng này Liên kết tới bài đăng Chia sẻ trên các trang web khác