Outlook 的 Explorer.ActiveInlineResponse 属性何时返回 null?

发布于 2025-01-10 00:03:50 字数 1141 浏览 0 评论 0原文

我试图确定 Outlook 的 Explorer.ActiveInlineResponse 属性何时返回 null。 文档链接指出, “如果阅读窗格中没有可见的内联响应,则此属性返回 Null(在 Visual Basic 中为 Nothing)”

到目前为止,我只能在从 Outlook 外部发送邮件时让 ActiveInlineResponse 返回 null。例如,Word/Excel 邮件合并或来自使用 Outlook 发送邮件的 VBA 项目。是否存在 ActiveInlineResponse 将返回 null 的其他情况? 我只关心 Outlook 邮件。

这是我的代码问题 -

        Outlook.Explorer explorer = Globals.ThisAddIn.Application.ActiveExplorer();
        explorer = Globals.ThisAddIn.Application.ActiveExplorer();
        Outlook.MailItem mailItem = Item as Outlook.MailItem;

        if (explorer.ActiveInlineResponse is Outlook.MailItem)
        {
            if (explorer.ActiveInlineResponse == null)
            {
                //When would the ActiveInlineResponse be null?
            }

            else if (explorer.ActiveInlineResponse != null)
            {
                //ActiveInlineResponse is not null when an item is being composed inline (reply,reply all or forward)
            }
        }

谢谢!

I'm attempting to determine when Outlook's Explorer.ActiveInlineResponse property will return null. The documentation link states, "This property returns Null (Nothing in Visual Basic) if no inline response is visible in the Reading Pane".

So far I've only been able to get ActiveInlineResponse to return null when sending mail from outside of Outlook. For example, a Word/Excel mail merge or from a VBA project that uses Outlook to send mail. Are there any other instances where ActiveInlineResponse will return null?
I'm only concerned with Outlook mailitems.

Here's my question in code-

        Outlook.Explorer explorer = Globals.ThisAddIn.Application.ActiveExplorer();
        explorer = Globals.ThisAddIn.Application.ActiveExplorer();
        Outlook.MailItem mailItem = Item as Outlook.MailItem;

        if (explorer.ActiveInlineResponse is Outlook.MailItem)
        {
            if (explorer.ActiveInlineResponse == null)
            {
                //When would the ActiveInlineResponse be null?
            }

            else if (explorer.ActiveInlineResponse != null)
            {
                //ActiveInlineResponse is not null when an item is being composed inline (reply,reply all or forward)
            }
        }

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

救星 2025-01-17 00:03:50

当然 - 这是可以预料的:Word/Excel 等不使用内联响应来发送消息,它们在单独的检查器中显示消息,可以使用 Application.ActiveInspector 检索该消息。

仅当用户回复或转发消息时才会显示内联响应 (Application.ActiveExplorer.ActiveInlineResponse)。

Of course - this is to be expected: Word/Excel etc. do not use inline response to send messages, they show messages in a separate inspector, which can be retrieved using Application.ActiveInspector.

Inline response (Application.ActiveExplorer.ActiveInlineResponse) is only shown when a user replies to or forwards a message.

心的位置 2025-01-17 00:03:50

首先,代码中没有调用 ActiveExplorer 方法两次:

Outlook.Explorer explorer = Globals.ThisAddIn.Application.ActiveExplorer();
explorer = Globals.ThisAddIn.Application.ActiveExplorer();

要获取 Outlook 资源管理器窗口中当前选定的项目,您可以使用 Selection Explorer 类的属性,返回一个Selection 对象,包含在资源管理器窗口中选择的一个或多个项目。例如:

private void DisplaySelectedItems()
{
    Outlook.Selection selection =
        Application.ActiveExplorer().Selection;
    for (int i = 1; i <= selection.Count; i++)
    {
        OutlookItem myItem = new OutlookItem(selection[i]);
        myItem.Display();
    }
}

Explorer.ActiveInlineResponse 属性返回一个项目对象,表示浏览器阅读窗格中的活动内联响应项目(正如它所说,它可用于回复和转发等任何响应)。

您可能会发现以下文章很有帮助:

First of all, there is no call the ActiveExplorer method twice in the code:

Outlook.Explorer explorer = Globals.ThisAddIn.Application.ActiveExplorer();
explorer = Globals.ThisAddIn.Application.ActiveExplorer();

To get the currently selected item in Outlook's explorer windows you can use the Selection property of the Explorer class which returns a Selection object that contains the item or items that are selected in the explorer window. For example:

private void DisplaySelectedItems()
{
    Outlook.Selection selection =
        Application.ActiveExplorer().Selection;
    for (int i = 1; i <= selection.Count; i++)
    {
        OutlookItem myItem = new OutlookItem(selection[i]);
        myItem.Display();
    }
}

The Explorer.ActiveInlineResponse property returns an item object representing the active inline response item in the explorer reading pane (as it states, it is available for for any responses like replies and forwards).

You may find the following articles helpful:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文