English 中文(简体)
我如何从选定的电子邮件信息中获取知识识别资料?
原标题:How do I obtain the Conversation ID from a selected email message?
  • 时间:2012-01-13 02:04:09
  •  标签:
  • vba
  • outlook

I d like obtain the Conversation ID (which is in the header of a message).

我假定,在展望图书馆,它属于“邮电系统”班级和电离层信息数据库成员。 我在如何从选定的电子邮件、开放式电子邮件或作为新邮局起火的事件中获取这种信息方面正遭受损失。

任何帮助都将受到全球教育论坛的赞赏。

问题回答

这一例子将在信息箱中显示对话情况。

Sub GetConvID()

Dim obj As Object
Dim msg As Outlook.mailItem

Set obj = GetCurrentItem

If TypeName(obj) = "MailItem" Then
  Set msg = obj
  MsgBox msg.ConversationID
End If

End Sub

Function GetCurrentItem() As Object
  returns reference to current item, either the one
  selected (Explorer), or the one currently open (Inspector)

  Select Case True
  Case IsExplorer(Application.ActiveWindow)
    Set GetCurrentItem = ActiveExplorer.Selection.item(1)
  Case IsInspector(Application.ActiveWindow)
    Set GetCurrentItem = ActiveInspector.CurrentItem
  End Select

End Function
Function IsExplorer(itm As Object) As Boolean
  IsExplorer = (TypeName(itm) = "Explorer")
End Function
Function IsInspector(itm As Object) As Boolean
  IsInspector = (TypeName(itm) = "Inspector")
End Function

关于新邮局:

The NewMail event is useful for scenarios in which you want to be notified when a new e-mail message arrives. If you want to process items that arrive in the Inbox, consider using the ItemAdd event on the collection of items in the Inbox. The ItemAdd event passes a reference to each item that is added to a folder.

为在这次活动中查阅选定的电子邮件,使用ActiveExplorer.Selection.item(1)。 查阅公开电子邮件:ActiveInspector.CurrentItem





相关问题
Handling no results for docmd.applyfilter

I have an Access app where I use search functionality. I have a TextBox and a Search Button on the form, and it does a wildcard search of whatever the user enters in the TextBox, and displays the ...

Outlook 2007 CommandBarControl.Execute won t work

I recently switched to Outlook 2007 and noticed that my VBA-macros won t work. I use the following code to open a new appointment-item (and fill it automatically). It worked perfect in Outlook 2003, ...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

MS Access: list macro from VBA

I have to deal with a few macros (not VBA) in an inherited Access application. In order to document them, I would like to print or list the actions in those macros, but I am very dissatisfied by ...

热门标签