'//設定信件的寄件者
memodoc.Principal = jmcdb.Server
'//Mail subject
Set memoDoc = New NotesDocument(jmcdb)
memodoc.Form = "Memo"
memodoc.Principal = jmcdb.Server
memodoc.Subject = SourceDB.Title + " CIMES轉入文件通知"
SendTo = DP '//部門群組
CopyTo = ""
BlindCopyTo = setupdoc.USEREmpEName2(0) '//data owner
BlindCopyTo = SP_aryAddItem(BlindCopyTo, setupdoc.ItmEmpEName(0))
'//建立內容的字型
Set RTItem = MemoDoc.CreateRichTextItem("Body")
richStyle.FontSize = 10
richStyle.NotesFont = RTItem.GetNotesFont("Arial", True)
Call RTItem.AppendStyle(richStyle)
Call RTItem.AppendParagraphStyle(rtpStyle)
'//mail header
richStyle.NotesColor = COLOR_BLACK
Call RTItem.AppendStyle(richStyle)
Call RTItem.AppendText("自CIMES轉入開立暫存文件:")
Call RTItem.AddNewLine(2,True)
'Dept No | Lot No.| Customer | PKG_Type
Call rtitem.AddTab(1)
Call rtitem.AppendText( Leftbp$("Dept No." + Space$(30), 30))
Call rtitem.AddTab(1)
Call rtitem.AppendText(Leftbp$("Lot No." + Space$(30), 30))
Call rtitem.AddTab(2)
Call rtitem.AppendText(Leftbp$("Customer" + Space$(30), 30))
'Call rtitem.AddTab(1)
Call rtitem.AppendText(Leftbp$("PKG_Type" + Space$(30), 30))
Call RTItem.AddNewLine(1,True)
'//mail body
rowCnt = 0
Do While Not alertdoc Is Nothing
Set alerttmp = alertcol.GetNextDocument(alertdoc)
Call SP_getContent(alertdoc, Cstr(DP))
Set alertdoc = alerttmp
Loop
'//send mail
If Isarray(sendto) Then
Call memoDoc.ReplaceItemValue("SendTo", Arrayunique(sendto))
Else
Call memoDoc.ReplaceItemValue("SendTo", sendto)
End If
If Isarray(copyto) Then
Call memoDoc.ReplaceItemValue("CopyTo", Arrayunique(copyto))
Else
Call memoDoc.ReplaceItemValue("CopyTo", (copyto))
End If
If Isarray(BlindCopyTo) Then
Call memoDoc.ReplaceItemValue("BlindCopyTo", Arrayunique(BlindCopyTo))
Else
Call memoDoc.ReplaceItemValue("BlindCopyTo", BlindCopyTo)
End If
沒有留言:
張貼留言