簡體   English   中英

將從模板創建的 Outlook 約會保存到非默認日歷

[英]Save Outlook appointment created from a template to non default calendar

我打開 Outlook 會議模板,並希望將創建的約會關聯到 Outlook 中的非默認日歷。 附加的代碼保存到默認日歷。

Sub Whatever()
Dim olApp As Object
Set olApp = GetObject(, "Outlook.Application")
Dim oApt As Outlook.AppointmentItem
Dim myTemplate As Object
Dim ns As Outlook.Namespace
Dim nsOther As Outlook.Recipient

Dim oFolder As Outlook.Folder
Dim template As String

template = "C:\Users\Some User\Meeting.oft"
Set myTemplate = olApp.CreateItemFromTemplate(template)
myTemplate.Recipients.Add ("someuser@contoso.com")
myTemplate.Start = "16/04/2019 10:30"
myTemplate.Display
myTemplate.Send

End Sub

這個問題是類似的,但將一個不是從模板創建的新會議保存到一個非默認日歷中。

這種方法將 html 存儲在 Excel 單元格中。

Application.CreateItemFromTemplate函數采用第二個(可選)參數 - 必須在其中創建約會的MAPIFolder

您的腳本必須初始化oFolder變量並將其傳遞給CreateItemFromTemplate

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM