CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

打印机后台打印警报属性 (ActiveX)

2023-1-3 08:03| 发布者: admin| 查看: 319| 评论: 0|来自: AutoCAD

摘要: 指定当设备的输出由于与 I/O 端口冲突而必须通过系统打印机假脱机时,是否提醒用户。

指定当设备的输出由于与 I/O 端口冲突而必须通过系统打印机假脱机时,是否提醒用户。

支持的平台:仅窗口

签名

工 务 局:

object.PrinterSpoolAlert
对象

类型:首选项输出

此属性适用的对象。

属性值

只读:

类型:枚举acPrinterSpoolAlert

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

言论

此属性的初始值为。acPrinterAlwaysAlert

例子

工 务 局:

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

Visual 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 )

GMT+8, 2024-5-12 10:47

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部