目前使用DATAOBJECT.GETTEXT方法只能将单元格内的文本拷贝过去,不能拷贝图片及相应表格。
LOTUS NOTES有没有什么方法可以读取剪贴板内容直接粘贴到新邮件中?
------解决方案--------------------------------------------------------
我这里有一个以前写的例子,
Sub aa()
Dim no As Object
Dim db As Object
Dim clipboard As DataObject
Dim doc As Object
Dim field As Object
Set no = CreateObject("notes.notessession") '建立和邮件的连接
Set db = no.CurrentDatabase
Set doc = db.CreateDocument
Set field = doc.CreateRichTextItem("body")
Selection.Copy
Set clipboard = New DataObject
clipboard.GetFromClipboard
With field
.AppendText "此邮件为系统自动发送,请不要回复,仅作为测试使用!"
.AddNewLine 2
.AppendText clipboard.GetText(1)
End With
With doc
.form = "Memo"
.sendto = "邮件地址"
.Subject = "自动邮件"
.SaveMessageOnSend = True
.postdate = Now()
.Send 0
End With
Selection(1).Select
Application.CutCopyMode = False
End Sub