Sub CreateFromTemplate() Dim MyItem As Outlook.MailItem Set MyItem = Application.CreateItemFromTemplate("C:\statusrep.oft") MyItem.Display End Sub Sub CreateTemplate() Dim MyItem As Outlook.MailItem Set MyItem = Application.CreateItem(olMailItem) MyItem.Subject = "Status Report" MyItem.To...
Sub CreateFromTemplate() Dim MyItem As Outlook.MailItem Set MyItem = Application.CreateItemFromTemplate("C:\statusrep.oft") MyItem.Display End Sub Sub CreateTemplate() Dim MyItem As Outlook.MailItem Set MyItem = Application.CreateItem(olMailItem) MyItem.Subject = "Status Report" MyItem.To...
全部显示 创建并返回新的 Microsoft Outlook 项目。CreateItem 方法仅可创建默认的 Outlook 项目。要创建使用自定义窗体的新项目,可使用 Items 集合…
Private Sub CreateMailItem() Dim mailItem As Outlook.MailItem = _ Me.Application.CreateItem(Outlook.OlItemType.olMailItem) mailItem.Subject = "This is the subject" mailItem.To = "someone@example.com" mailItem.Body = "This is the message." mailItem.Importance = Outlook.OlImportance.olImpo...
OL.Application app =newOL.Application(); OL.MailItem mail = app.CreateItemFromTemplate(TemplatePath)asOL.MailItem;if(!string.IsNullOrEmpty(To)) mail.To = To;if(!string.IsNullOrEmpty(From)) mail.SentOnBehalfOfName = From;if(!string.IsNullOrEmpty(BCC)) ...
Outlook.Application Dim MyItem As Outlook.MailItem Set myOlApp = CreateObject("Outlook.Application") Set MyItem = myOlApp.CreateItem(olMailItem) MyItem.Subject = "Status Report" MyItem.To = "Dan Wilson" MyItem.Display MyItem.SaveAs "C:\statusrep.oft", OlSaveAsType.olTemplate End Sub...
Application.CreateItemFromTemplate("C:\statusrep.oft") MyItem.DisplayEndSubSubCreateTemplate()DimMyItemAsOutlook.MailItemSetMyItem = Application.CreateItem(olMailItem) MyItem.Subject ="Status Report"MyItem.To="Dan Wilson"MyItem.Display MyItem.SaveAs"C:\statusrep.oft", OlSaveAsType.olTemplate...
Application.CreateItemFromTemplate("C:\statusrep.oft") MyItem.DisplayEndSubSubCreateTemplate()DimMyItemAsOutlook.MailItemSetMyItem = Application.CreateItem(olMailItem) MyItem.Subject ="Status Report"MyItem.To="Dan Wilson"MyItem.Display MyItem.SaveAs"C:\statusrep.oft", OlSaveAsType.olTemplate...
(Outlook.OlItemType.olMailItem);// Set HTMLBody.//add the body of the emailoMsg.HTMLBody += msg;//Add an attachment.String sDisplayName ="Coopcheck Log";intiPosition = (int)oMsg.Body.Length +1;intiAttachType = (int)Outlook.OlAttachmentType.olByValue;// now attached the fileOutlook....
ItemType必要OlItemType新項目的 Outlook 項目類型。 傳回值 代表新 Outlook 專案的Object值。 註解 CreateItem方法只能建立預設的 Outlook 項目。 若要使用自訂表單建立新專案,請使用Items集合上的Add方法。 範例 下列Microsoft Visual Basic for Applications (VBA) 範例會建立新的MailItem物件,並將BodyFormat屬性設定...