如何禁用Ctrl + P键,使用户不能直接打印当前打开的文档?

问题描述 投票:2回答:1

而在LotusScript中工作,我希望我的用户不能够通过按下Ctrl + P打印文档。取而代之的是,我提供了一个操作按钮,因此,它使一些额外的步骤,在打印文档前。这是可以禁用使用LotusScript或Java直接打印(CTRL + P)。或作为替代是有可能,我们可以捕捉Ctrl + P键事件,做到真正的印刷继续之前,我们可能会增加我们的代码。

我使用的版本9.0.1FP8

java lotus-notes lotusscript
1个回答
4
投票

添加一个名为$ KeepPrivate一个计算字段的“1”的值。此字段防止用户使用CTRL + P。

然后用下面的逻辑添加自己的按钮:

Sub Click(Source As Button)

    Dim ws As New NotesUIWorkspace
    Dim uidoc As NotesUIDocument
    Dim doc As NotesDocument
    Set uidoc = ws.CurrentDocument
    Set doc = uidoc.Document
    Call doc.RemoveItem("$KeepPrivate")
    Call doc.Save(True,True)
    doc.SaveOptions = "0"
    Call uidoc.Close
    Set uidoc = ws.EditDocument(True,doc,False) 
    Call uidoc.Print
    Dim item As New NotesItem(doc,"$KeepPrivate","1")
    Call uidoc.Save
    Call doc.Save(True,True)
    doc.SaveOptions = "0"

End Sub

此按钮将改变背后的幕后的$ KeepPrivate字段的值并显示打印对话框。

© www.soinside.com 2019 - 2024. All rights reserved.