Outlook 的 Explorer.ActiveInlineResponse 属性何时返回 null?
我试图确定 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当然 - 这是可以预料的: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.首先,代码中没有调用
ActiveExplorer
方法两次:要获取 Outlook 资源管理器窗口中当前选定的项目,您可以使用 Selection
Explorer
类的属性,返回一个Selection
对象,包含在资源管理器窗口中选择的一个或多个项目。例如:Explorer.ActiveInlineResponse 属性返回一个项目对象,表示浏览器阅读窗格中的活动内联响应项目(正如它所说,它可用于回复和转发等任何响应)。
您可能会发现以下文章很有帮助:
First of all, there is no call the
ActiveExplorer
method twice in the code:To get the currently selected item in Outlook's explorer windows you can use the Selection property of the
Explorer
class which returns aSelection
object that contains the item or items that are selected in the explorer window. For example: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: