这个问题早就解决了:
以下程序可以将之前打印图纸时的打印机保存起来给下次打印其它图纸时用。
-
-
-
-
- 'http:
-
-
-
-
-
-
-
- ' 用途之适应性, 以及商业销售所隐含作出的保证, 在此一概予以否认。Option Explicit
- Dim PrintName As String
- Dim BigLWeight As String
- Dim ConfigName As String
- Dim PStyleName As String
-
-
-
- Private Sub AcadDocument_BeginCommand(ByVal CommandName As String)
- If CommandName = "PAGESETUP" Or CommandName = "PLOT" Then
- Call GetPrintName
- End If
- End Sub
- Private Sub AcadDocument_EndCommand(ByVal CommandName As String)
- If CommandName = "PAGESETUP" Or CommandName = "PLOT" Then
- Call SetPrintName
- End If
- End Sub
- Private Sub GetPrintName()
- PrintName = GetSetting("MCCAD", "DrawingSetting", "PrintName")
-
- If PrintName "" And ThisDrawing.ActiveLayout.ConfigName PrintName Then
- ThisDrawing.ActiveLayout.RefreshPlotDeviceInfo
- On Error Resume Next
- ThisDrawing.ActiveLayout.ConfigName = PrintName
- End If
- End Sub
- Private Sub SetPrintName()
- If PrintName = "" Then
- SaveSetting "MCCAD", "DrawingSetting", "PrintName", ThisDrawing.ActiveLayout.ConfigName
- Else
- If ThisDrawing.ActiveLayout.ConfigName PrintName Then
- If MsgBox("是否将“" & ThisDrawing.ActiveLayout.ConfigName & "”打印机做为默认打印机?", vbYesNo) = vbYes Then
- SaveSetting "MCCAD", "DrawingSetting", "PrintName", ThisDrawing.ActiveLayout.ConfigName
- End If
- End If
- End If
- End Sub
|