You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

更新Outlook Redemption会议实例HTMLBody后收件人清零问题求助

更新说明

最终目标:将更新后的会议内容发送给该会议实例的现有收件人。

尝试更新一个已有多个收件人的周期性会议实例的HTMLBody,但更新后收件人数量变为0,发送时失败并提示“邮件无收件人”。

以下是第一次尝试的代码:

public static void GetSomething()
{
    var entryID = "00000000C97FEB5BB4BE2046B4C77ADEB3C423010700BA6ADFD7533DD244B122D7B9F3B5664000000000010D0000BA6ADFD7533DD244B122D7B9F3B56640000269310F930000";
    RDOAppointmentItem appointment = null;
    RDORecurrencePattern pattern = null;
    RDOMail occurrence = null;
    try
    {
        appointment = rSession.GetMessageFromID(entryID) as RDOAppointmentItem;
        if (appointment != null)
        {
            pattern = appointment.GetRecurrencePattern();
            if (pattern != null)
            {
                occurrence = pattern.GetOccurrence(1);
                if (pattern != null) Marshal.ReleaseComObject(pattern);
                if (appointment != null) Marshal.ReleaseComObject(appointment);
                occurrence.HTMLBody = @"<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<p>This is a paragraph.</p>

</body>
</html>";
                occurrence.Send();
            }
        }
    }
    catch (Exception e)
    {
        Debug.DebugMessage(2, $"Error in {MethodBase.GetCurrentMethod().Name} | {e.Message}");
    }
    finally
    {
        if (occurrence != null) Marshal.ReleaseComObject(occurrence);
    }
}

之后尝试了添加再删除收件人的方法,该方法能发送邮件,但发送的会议请求中新增的收件人并未被移除,尽管本地日历中的会议实例里该收件人已被移除。

以下是对应的尝试代码:

public static void GetSomething()
    {
        var entryID = "00000000C97FEB5BB4BE2046B4C77ADEB3C423010700BA6ADFD7533DD244B122D7B9F3B5664000000000010D0000BA6ADFD7533DD244B122D7B9F3B56640000269310F930000";
        RDOAppointmentItem appointment = null;
        RDORecurrencePattern pattern = null;
        RDOMail occurrence = null;
        try
        {
            appointment = rSession.GetMessageFromID(entryID) as RDOAppointmentItem;
            if (appointment != null)
            {
                pattern = appointment.GetRecurrencePattern();
                if (pattern != null)
                {
                    occurrence = pattern.GetOccurrence(1);
                    if (pattern != null) Marshal.ReleaseComObject(pattern);
                    if (appointment != null) Marshal.ReleaseComObject(appointment);
                    RDORecipients oldRecipients = occurrence.Recipients;
                    var oldRecCount = oldRecipients.Count;
                    RDORecipient recipient = oldRecipients.AddEx("Test", "test@gmail.com", "SMTP", 1);
                    if (recipient != null) Marshal.ReleaseComObject(recipient);
                    if (oldRecipients != null) Marshal.ReleaseComObject(oldRecipients);
                    occurrence.HTMLBody = @"<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<p>This is a paragraph.</p>

</body>
</html>";
                    RDORecipients newRecipients = occurrence.Recipients;
                    newRecipients.Remove(oldRecCount + 1);
                    if (newRecipients != null) Marshal.ReleaseComObject(newRecipients);
                    occurrence.Send();
                }
            }
        }
        catch (Exception e)
        {
            Debug.DebugMessage(2, $"Error in {MethodBase.GetCurrentMethod().Name} | {e.Message}");
        }
        finally
        {
            if (occurrence != null) Marshal.ReleaseComObject(occurrence);
        }
    }
}

内容的提问来源于stack exchange,提问作者Kvu

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.02 05:35:41