- 帖子
- 63
- 主題
- 8
- 精華
- 0
- 積分
- 122
- 點名
- 0
- 作業系統
- Windows 2007
- 軟體版本
- Office 2007
- 閱讀權限
- 20
- 性別
- 男
- 來自
- Taiwan
- 註冊時間
- 2019-4-16
- 最後登錄
- 2023-3-24
|
2#
發表於 2021-2-3 14:35
| 只看該作者
Hello, All
如下所示, 我找到了一個土法練鋼的方式!!
即在Excel內將表格轉為圖片, 然後再將此圖片轉貼至IBM Notes裡,
最後再將產生的圖片刪除, 即可.
如此一來, 除非Target端不接受圖片, 否則就不用去考慮其是什麼格式了!!
與大夥分享.....Thanks ~~
[[程式段]]
Dim es As Object
Dim at As Object
Dim Work As Object
Dim oc As Object
Dim doc As Object
Dim rgPic As Range
Dim strMsg As String
Dim UserName As String 'The current users notes name
Dim MailDbName As String 'THe current users notes mail database name
Dim dbleCPRow As Double
Set es = CreateObject("Notes.NotesSession")
Set Work = CreateObject("Notes.NotesUIWorkspace")
UserName = es.UserName
MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
Set at = es.GetDataBase(vbNullString, MailDbName)
If Not at.IsOpen Then
at.OPENMAIL
Else
MsgBox "Mail Open Fail..!"
End If
Set oc = at.CreateDocument
With oc
.Form = "Memo"
.sendto = "david"
.Subject = "Mail Sending Try..."
End With
dblCPRow = Application.WorksheetFunction.CountIf(Range("$H$3 H$666"), "<>") + 2 ' +2 is report title ignored
Set doc = Work.EDITDocument(True, oc)
With doc
.InsertText ("<< Mail autot Sending >> " & vbNewLine )
Set rgPic = Range("A2:K" & dblCPRow)
rgPic.CopyPicture Appearance:=xlScreen, Format:=xlPrinter ' Trans Excel Table to Picture mode.
With ActiveSheet.ChartObjects.Add(Left:=rgPic.Left, Top:=rgPic.Top, Width:=rgPic.Width, Height:=rgPic.Height) ' Set Picture name to tmpChart
.Name = "tmpChart"
.Activate
End With
.Paste
Application.CutCopyMode = False
ActiveSheet.ChartObjects("tmpChart").Delete ' Delete this template chart.
.send
.Close
End With
Set es = Nothing
Set at = Nothing
Set Work = Nothing
Set oc = Nothing
Set doc = Nothing
set rgPic =Nothing
MsgBox "Mail had been sent..!" |
|