|
楼主 |
发表于 2012-12-5 21:21
|
显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
本帖最后由 tonyibm 于 2012-12-5 21:23 编辑
对于你的第二个问题,我偶然发现下面的方式可以解决,只不过这样会让附件出现在邮件正文上面的灰色区域,
[code=vb]Sub test()
Dim anotes
Dim aDataBase
Dim ws As Object
Dim notesdoc
Dim field
Dim att As Variant
Dim x As Integer
Dim uidoc As Object
att = Application.GetOpenFilename(filefilter:="All file,*.*", MultiSelect:=True)
Set ws = CreateObject("Notes.NotesUIWorkspace")
Set anotes = CreateObject("Notes.NotesSession")
Set aDataBase = anotes.GETDATABASE("", "C:\notes\data\mail3\tonyhf.nsf")
Set notesdoc = aDataBase.CREATEDOCUMENT
Set uidoc = ws.CURRENTDOCUMENT()
Set field = notesdoc.CREATERICHTEXTITEM("body1")
For x = 1 To UBound(att)
field.embedobject 1454, "", att(x)
Next x
Set uidoc = ws.EDITDOCUMENT(True, notesdoc)
End Sub
[/code]
起作用的代码是:
Set field = notesdoc.CREATERICHTEXTITEM("body1"), 注意这里不是body, 而是body1,
|
|