PrintSpoolExecutable 属性 (ActiveX) 
指定要用于打印后台处理的应用程序。 支持的平台:仅限 Windows 属性值只读:不 类型:字符串 打印后台打印应用程序。 言论此属性包含用于 AutoSpool 的打印后台处理可执行文件的驱动器、路径和应用程序名称。 例子VBA: Sub Example_PrintSpoolExecutable()
    ' This example returns the current setting of
    ' PrintSpoolExecutable. It then changes the value, and finally
    ' it resets the value back to the original setting.
    
    Dim preferences As AcadPreferences
    Dim currPrintSpoolExecutable As String
    Dim newPrintSpoolExecutable As String
    
    Set preferences = ThisDrawing.Application.Preferences
    
    ' Retrieve the current PrintSpoolExecutable value
    currPrintSpoolExecutable = preferences.Files.PrintSpoolExecutable
    MsgBox "The current value for PrintSpoolExecutable is " & currPrintSpoolExecutable, vbInformation, "PrintSpoolExecutable Example"
    
    ' Change the value for PrintSpoolExecutable
    newPrintSpoolExecutable = "TestPrintSpoolExecutable"
    preferences.Files.PrintSpoolExecutable = newPrintSpoolExecutable
    MsgBox "The new value for PrintSpoolExecutable is " & newPrintSpoolExecutable, vbInformation, "PrintSpoolExecutable Example"
    
    ' Reset PrintSpoolExecutable to its original value
    preferences.Files.PrintSpoolExecutable = currPrintSpoolExecutable
    MsgBox "The PrintSpoolExecutable value is reset to " & currPrintSpoolExecutable, vbInformation, "PrintSpoolExecutable Example"
End Sub
可视化 LISP: (vl-load-com)
(defun c:Example_PrintSpoolExecutable()
    ;; This example returns the current setting of
    ;; PrintSpoolExecutable. It then changes the value, and finally
    ;; it resets the value back to the original setting.
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))
    
    ;; Retrieve the current PrintSpoolExecutable value
    (setq currPrintSpoolExecutable (vla-get-PrintSpoolExecutable (vla-get-Files preferences)))
    (alert (strcat "The current value for PrintSpoolExecutable is " currPrintSpoolExecutable))
    
    ;; Change the value for PrintSpoolExecutable
    (setq newPrintSpoolExecutable "TestPrintSpoolExecutable")
    (vla-put-PrintSpoolExecutable (vla-get-Files preferences) newPrintSpoolExecutable)
    (alert (strcat "The new value for PrintSpoolExecutable is " newPrintSpoolExecutable))
    
    ;; Reset PrintSpoolExecutable to its original value
    (vla-put-PrintSpoolExecutable (vla-get-Files preferences) currPrintSpoolExecutable)
    (alert (strcat "The PrintSpoolExecutable value is reset to " currPrintSpoolExecutable))
)
 | 
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1   苏公网安备32011402011833)
GMT+8, 2025-11-4 15:15
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.