如何预约其他用户的展望? [英] How to set an appointment to other users on outlook?

查看:160
本文介绍了如何预约其他用户的展望?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我使用管理员帐户登录到操作系统,并且有权限向其他用户设置约会,而不发送邮件。

Let's say I log in to the OS with administrator account and have permissions to set appointments to other users, without sending a mail.

我该怎么做代码?
我只能找到使用AppontmentItem的示例,并设置一个预约到本地机器的前景。如何为外部用户做?

How can I do it in the code? I could only find examples working with AppontmentItem and set an appointment to the local machine's outlook. How can I do it for external users?

非常感谢提前!

    private static void AddAppointment()
    {


            Outlook.Application outlookApp = new Outlook.Application(); // creates new outlook app
            Outlook.AppointmentItem oAppointment =
                (Outlook.AppointmentItem) outlookApp.CreateItem(Outlook.OlItemType.olAppointmentItem);
                // creates a new appointment

            oAppointment.Subject = "Enquiry Changes made to john enquiry"; // set the subject
            oAppointment.Body = "This is where the appointment body of the appointment is written"; // set the body
            oAppointment.Location = "Nicks Desk!"; // set the location
            oAppointment.Start = DateTime.Now.AddHours(2);
            oAppointment.End = DateTime.Now.AddHours(3);
            oAppointment.ReminderSet = true; // Set the reminder
            oAppointment.ReminderMinutesBeforeStart = 15; // reminder time
            oAppointment.Importance = Outlook.OlImportance.olImportanceHigh; // appointment importance
            oAppointment.BusyStatus = Outlook.OlBusyStatus.olBusy;
            oAppointment.Save();
            Outlook.MailItem mailItem = oAppointment.ForwardAsVcal();
    }


推荐答案

使用Namespace.GetSharedDefaultFolder()打开其他用户的日历文件夹,然后使用MAPIFolder.Items.Add创建约会。

Use Namespace.GetSharedDefaultFolder() to open other user's Calendar folder, then create an appointment using MAPIFolder.Items.Add.

这篇关于如何预约其他用户的展望?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆