發送用戶定義的字段我一直在苦苦掙扎在這個問題上並停止約3周。我創建了一個Outlook自定義形式,讓我已經創建了一個用戶定義的字段的用戶類型(姑且稱之爲myField1,myField2)與標準爲,CC,主題沿着 ,日期領域。Outlook自定義窗體:在HTML
用戶填寫表單,點擊發送,而不是發送自定義窗體給收件人,我希望它送我的用戶定義字段(HTML?)和關閉形式窗口。這使得收件人可以查看和打印Outlook的預覽窗格中輸入的字段並使其可讀。我應該在探索Outlook區域表單以瞭解我正在嘗試做什麼?我現在的代碼不會產生錯誤,但它什麼也不做! - 表格以表格形式發送。我所訪問的腳本編輯器在Outlook 2010中非常沮喪..
Function Item_Send()
'Dim olApp As Outlook.Application
'Dim objNS As Outlook.NameSpace
'Dim mailItem As Outlook.mailItem
Set olApp = CreateObject("Outlook.Application")
'Outlook.ApplicationClass _app = new Outlook.ApplicationClass();
'Outlook.Application olApp = (Outlook.Application)_app
'Outlook.NameSpace olNameSpace = _app.GetNamespace("MAPI")
'Create mail item
'Set objMail = myOlApp.GetItem(OlItemType.olMailItem)
Set mailItem = Application.CreateItem(olMailItem)
'Outlook.mailItem mailItem = (Outlook.mailItem)olApp.CreateItem(Outlook.OlItemType.olMailItem)
'With mailItem
mailItem.Subject = item.Subject
mailItem.Recipients.Add ("emails that I typed into the To: box")
mailItem.Body = "This is the Body of an e-mail message"
'Set body format to HTML
mailItem.BodyFormat = 2
mailItem.HTMLBody = "<HTML><H2>The body of this message will appear in HTML.</H2><BODY>Type the message text here. </BODY></HTML>"
mailItem.Send()
'End With
'Set olMailItem = Nothing
Set olApp = Nothing
End Function
我發現身體是比較容易的部分,並將其保存到最後。 –