我们的旧代码中有 InkPicture OLE 对象。它所在的子表单具有以下严重警告:
为防止丢失 InkPicture OLE 对象的属性,签名子表单只能在安装了 Microsoft Tablet PC Platform SDK 的 PC 上编辑!
不要删除签名 OLE 对象前面的空格。这样做可能会导致笔记崩溃,具体取决于您使用的版本
已编辑以添加到您使用 Create-Object 的表单并选择控件。控件是 InkPicture。然后我们有一个按钮将其保存到富文本字段中:
{子点击(来源为按钮)
Const GIF=2
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim sig As Variant
Dim tempfile As String
Dim sig2 As Variant
Dim tempfile2 As String
Dim picstream As NotesStream
Dim session As New NotesSession
Dim dtEpoch As New NotesDateTime("1/1/2000 00:00:00")
Dim dtNow As New NotesDateTime(Now)
Dim dtTemp As Variant
Dim Rectangle As Variant
Set uidoc = ws.CurrentDocument
' write the contents of the ink object to a temporary file
Set sig = uidoc.GetObject("SignatureInk1")
Set sig2 = uidoc.GetObject("SignatureInk2")
Set Rectangle = CreateObject("msinkaut.Inkrectangle")
'The rectangle is used to clip the signature if it is too big.
Rectangle.SetRectangle -300,0,2000,8000
If Not sig Is Nothing Then
If sig.Ink.Strokes.Count=0 Then
Else
dtTemp=dtNow.TimeDifference(dtEpoch)
tempfile = Session.GetEnvironmentString("Directory", True)+"\~1"+dtTemp+".tmp"
Set picstream = session.CreateStream
sig.Ink.Strokes.Clip Rectangle
picstream.Open(tempfile)
picstream.Write sig.Ink.Save(GIF)
picstream.Close
sig.Enabled = False
sig.Ink.DeleteStrokes sig.Ink.Strokes
sig.Enabled = True
sig.InkEnabled = True
uidoc.GotoField "Signature1"
uidoc.FieldClear
uidoc.Import "GIF Image", tempfile
Kill tempfile
End If
End If
If Not sig2 Is Nothing Then
If sig2.Ink.Strokes.Count=0 Then
Else
dtTemp=dtNow.TimeDifference(dtEpoch)
tempfile2 = Session.GetEnvironmentString("Directory", True)+"\~2"+dtTemp+".tmp"
Set picstream = session.CreateStream
sig2.Ink.Strokes.Clip Rectangle
picstream.Open(tempfile2)
picstream.Write sig2.Ink.Save(GIF)
picstream.Close
sig2.Enabled = False
sig2.Ink.DeleteStrokes sig2.Ink.Strokes
sig2.Enabled = True
sig2.InkEnabled = True
uidoc.GotoField "Signature2"
uidoc.FieldClear
uidoc.Import "GIF Image", tempfile2
Kill tempfile2
End If
End If
结束子}
此按钮可确保实际图像的大小合理,因为他的控制允许在整个屏幕上涂鸦。
尼克弗莱帮我回答了这个问题。希望这可以帮助。