0
나는 추가 기능에 정말 새로운 기능을 제공합니다. 내 코드는 다음을 수행해야합니다. Outlook 사용자가 아무 것도 저장/생성하지 않습니다. 생성 된 항목이 약속 항목 인 경우 시스템은 항목 제목을 파일 이름으로 사용하여 c : 디렉토리 아래에 저장해야합니다. 여기 내 코드가있다. 거기에 뭐가 잘못 되었나요?캘린더 용 Outlook 추가 기능
참고 : 새 약속을 만들 때 if 절이 작동합니다. 다른 코드를 작성하면 작동하지만, ai.Subject
과 같은 인공 지능 정보를 가져올 수 없습니다.
namespace SendToMRBS
{
public partial class ThisAddIn
{
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
this.Application.ItemLoad += new Outlook.ApplicationEvents_11_ItemLoadEventHandler(Application_ItemLoad);
}
void Application_ItemLoad(object Item)
{
if (Item is Outlook.AppointmentItem)
{
Outlook.AppointmentItem ai = Item as Outlook.AppointmentItem;
ai.SaveAs("C:\\" + ai.Subject, Microsoft.Office.Interop.Outlook.OlSaveAsType.olICal);
}
}
private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
}
#region VSTO generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InternalStartup()
{
this.Startup += new System.EventHandler(ThisAddIn_Startup);
this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
}
#endregion
}
}