CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2025 开发者帮助

PrinterSpoolAlert 属性 (ActiveX)

2024-5-18 19:21| 发布者: admin| 查看: 85| 评论: 0|原作者: admin|来自: AutoCAD

PrinterSpoolAlert 属性 (ActiveX)

指定当由于与 I/O 端口冲突而必须通过系统打印机对设备的输出进行假脱机处理时,是否向用户发出警报。

支持的平台:仅限 Windows

签名

VBA:

object.PrinterSpoolAlert
对象

类型:首选项输出

此属性应用于的对象。

属性值

只读:

类型:枚举acPrinterSpoolAlert

  • acPrinterAlwaysAlert:始终发出警报并记录错误。
  • acPrinterAlertOnce:仅对第一个错误发出警报并记录所有错误。
  • acPrinterNeverAlertLogOnce:从不发出警报,但记录所有错误。
  • acPrinterNeverAlert:从不发出警报,也不记录任何错误。

言论

此属性的初始值为 。acPrinterAlwaysAlert

例子

VBA:

Sub Example_PrinterSpoolAlert()
    ' This example reads and modifies the PrinterSpoolAlert
    ' preference value.
    ' When finished, this example resets the preference value back to
    ' its original value.
    
    Dim ACADPref As AcadPreferencesOutput
    Dim originalValue As Integer
    
    ' Get the user preferences object

    Set ACADPref = ThisDrawing.Application.Preferences.Output
    
    ' Read and display the original value
    originalValue = ACADPref.PrinterSpoolAlert
    MsgBox "The PrinterSpoolAlert preference is set to: " & originalValue

    ' Modify the PrinterSpoolAlert preference by toggling the value
    ACADPref.PrinterSpoolAlert = acPrinterNeverAlert
    MsgBox "The PrinterSpoolAlert preference has been set to: " & ACADPref.PrinterSpoolAlert

    ' Reset the preference back to its original value
    ACADPref.PrinterSpoolAlert = originalValue
    MsgBox "The PrinterSpoolAlert preference was reset back to: " & originalValue
End Sub

可视化 LISP:

(vl-load-com)
(defun c:Example_PrinterSpoolAlert()
    ;; This example reads and modifies the PrinterSpoolAlert
    ;; preference value.
    ;; When finished, this example resets the preference value back to
    ;; its original value.
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))
    
    ;; Read and display the original value
    (setq originalValue (vla-get-PrinterSpoolAlert (vla-get-Output preferences)))
    (alert (strcat "The PrinterSpoolAlert preference is set to: " (itoa originalValue)))

    ;; Modify the PrinterSpoolAlert preference by toggling the value
    (vla-put-PrinterSpoolAlert (vla-get-Output preferences) acPrinterNeverAlert)
    (alert (strcat "The PrinterSpoolAlert preference has been set to: " (itoa (vla-get-PrinterSpoolAlert (vla-get-Output preferences)))))

    ;; Reset the preference back to its original value
    (vla-put-PrinterSpoolAlert (vla-get-Output preferences) originalValue)
    (alert (strcat "The PrinterSpoolAlert preference was reset back to: " (itoa (vla-get-PrinterSpoolAlert (vla-get-Output preferences)))))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1   苏公网安备32011402011833)

GMT+8, 2024-12-15 22:31

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部