outlook电子邮件解析
Being an active EE Expert means to get a lot of (E)EMail, as you certainly know. If you are using Outlook, I'll show you how to minimize your inbox contents without losing anything – even improve the experience by changing the Subject line to facilitate sorting and by adding tags for quick recognition.
众所周知,成为一名活跃的EE专家意味着要获得大量(E)EMail。 如果您使用的是Outlook,我将向您展示如何在不损失任何内容的情况下最大程度地减少收件箱中的内容,甚至可以通过更改“主题”行以方便排序以及添加标签以快速识别来改善体验。
The "Framework" that I present below has been tested with Outlook 2003, 2007 and 2010. Since VBA Macros are used, you might have to allow macro execution when starting Outlook.
我在下面介绍的“框架”已经在Outlook 2003、2007和2010中进行了测试。由于使用了VBA宏,因此启动Outlook时可能必须允许宏执行。
We utilize so-called User Properties, which have some particularities, but are great for holding additional user-definied content.
我们利用所谓的“用户属性”,它具有一些特殊性,但是对于保存其他用户定义的内容非常有用。
I have not tested the code provided if it works flawlessly with HTML mails, only with plain text.
Since the mail content and subject can change at any time, it might not work anymore after new releases were published.
由于邮件内容和主题可以随时更改,因此在发布新版本后可能不再起作用。
There are many different types of emails you can get, distinguished by the text of the Subject line. Getting a newer email might render formerly received ones void, or newer ones are not interesting because you already have been informed. To build logic around that can get quite complex. I have tried to make the rules as easy to understand and implement as possible. Now, let's start with the enumeration of possible headers and actions:
您可以通过主题行的文本来区分许多不同类型的电子邮件。 收到更新的电子邮件可能会使以前收到的电子邮件无效,或者更新的电子邮件变得没有意思,因为您已经被告知。 围绕此构建逻辑可能会变得非常复杂。 我试图使规则尽可能容易理解和实施。 现在,让我们开始列举可能的标题和动作:
A new question your filter has trapped. This is usually the first mail you get, if you have set up filters with alerts.
A question which is neglected. You are Designated Expert in one of the zones, and this message is not depending on any filter you have set up.
If you receive this, you won't need the "Expert Alert" anymore, so the code will delete that one, if found. (Note that the subject line has two spaces after the colon.)
An Expert has posted to a question you have contributed to or subscribed. That might be interesting for you, as it could bring new insight or alternatives, or pose additional questions. Some good solutions originate in Experts working together, improving successively each other recommendations.
If you get a new "Comment Added" mail while having other emails of the same subject, it is time to decide what you want to keep:
Are you more interested in the first comment after your own, so you can click on the link and directly jump to that comment, and than read the remaining thread to keep up with everything?
Is it more important to always have the newest post in your inbox, so you know if there is an ongoing discussion?
Or aren't you interested at all in this, so it should be dismissed?
Anyway, "Expert Alerts" and "Neglected Question Alerts" are moot now – you have subscribed, probably posted a comment yourself; either way, you know already about that question.
The Author of the question has posted. This is most important, of course, because usually answers (or more questions!) arise from that.
An Author Comment can be handled like an Expert Comment; that is, only the newest or oldest need to be kept (see above).
Or an Author Comment is more important than any other comment, and replace all other earlier mails which are not Author Comments – or even those.
This are good news! You have received points.
After having received this mail you will usually not want to keep any other mail regarding the same topic, so the code will remove them. I recommend to always open the question to see which other posts have been accepted, whether the correct answer(s) have been selected, and so on.
Not good. The question is closed, and you do not get points.
您的过滤器遇到了一个新问题。 如果您设置了带有警报的过滤器,通常这是您收到的第一封邮件。
一个被忽略的问题。 您是其中一个区域的指定专家,并且此消息不取决于您设置的任何过滤器。
如果收到此消息,则不再需要“专家警报”,因此如果找到该代码,该代码将删除该警报。 (请注意,主题行在冒号后面有两个空格。)
专家已将您发布或订阅的问题发布到了您的问题上。 这可能对您来说很有趣,因为它可能带来新的见解或替代方法,或者提出其他问题。 一些好的解决方案源自专家们的共同努力,彼此相继提出建议。
如果您在收到具有相同主题的其他电子邮件的同时收到新的“已添加评论”邮件,那么该是时候确定要保留的内容了:
您是否对自己后的第一个评论更感兴趣,因此您可以单击链接并直接跳至该评论,而不是阅读其余主题以了解所有内容。
始终在收件箱中保留最新帖子是否更重要,以便您知道是否正在进行讨论?
还是您根本不对此感兴趣,因此应该将其消除?
无论如何,“专家警报”和“被忽略的问题警报”现在都没有意义-您已订阅,可能自己发表了评论; 无论哪种方式,您已经知道该问题。
问题的作者已发布。 当然,这是最重要的,因为通常会由此得出答案(或更多问题!)。
作者评论可以像专家评论一样处理; 也就是说,仅需要保留最新的或最早的(请参见上文)。
或者,“作者评论”比其他任何评论都重要,并替换所有其他不是“作者评论”或什至不是“作者评论”的早期邮件。
这是好消息! 您已获得积分。
收到此邮件后,您通常将不希望保留与该主题相关的其他任何邮件,因此该代码会将其删除。 我建议始终打开一个问题,以查看其他哪些帖子已被接受,是否选择了正确的答案等等。
不好。 问题已结束,您没有得到积分。
The tag (and some other info) is added as a so-called User Property – something I have to explain in another article, because it is a too complex matter to keep discuss that here.
标记(以及其他一些信息)被添加为所谓的“用户属性”,这是我必须在另一篇文章中解释的内容,因为要在此继续讨论是一件非常复杂的事情。
The following mails are more difficult, as they do not contain the referred question (or article) in the subject. Hence the email body needs to be parsed for keywords, and those replace the original subject:
以下邮件比较困难,因为它们在主题中不包含所提及的问题(或文章)。 因此,需要对电子邮件正文进行关键字解析,然后替换原来的主题:
Great, you really got (another) rank!
太好了,您真的获得了(另一个)排名!
When receiving, the code should automatically generate the corresponding certificate, print it out, and open a bottle of champagne. Just kidding ;-).
收到代码后,代码应自动生成相应的证书,将其打印出来,然后打开一瓶香槟。 开玩笑 ;-)。
What the code really does is parsing rank (Master, Guru etc.) and Zone out of the body to fill that into the subject.
代码真正要做的是从体内解析等级(Master,Guru等)和Zone,将其填充到主题中。
Either the Asker has decided to remove the question, or a Cleanup Volunteer did because of lack of recent posts.
提问者决定删除该问题,或者是由于缺少最新帖子而导致的“清理志愿者”。
You should review this question in case you want to object to the deletion.
如果您要反对删除,则应查看此问题。
The Asker, a Moderator or Zone Advisor has started the "Auto-Close" with 4 days grace period.
询问者,主持人或区域顾问已以4天的宽限期开始“自动关闭”。
Since it is totally unclear if you will receive any points, you should review the question for details.
由于尚不清楚您是否会获得任何积分,因此您应该查看问题以获取详细信息。
A Page Editor has set your article to Author Review, and you need to return to the article to continue with editing.
页面编辑器已将您的文章设置为“作者审阅”,您需要返回该文章以继续进行编辑。
The question was in the process of being deleted or closed, with a grace period of 4 days, and somebody has objected to that. Since this requires a reaction from your side, no particular automation is applied.
该问题正在被删除或关闭,其宽限期为4天,有人对此表示反对。 由于这需要您的React,因此无需应用任何特定的自动化方法。
You have just earned enough points in a zone for becoming a Designated Expert in it, and you have not opted out to the Designated Expert feature as a whole. Since this means you get more "NQ" alerts though you might not be that confident in your related knowledge, removing the new zone in your Member Profile could be a good idea.
您刚刚在区域中获得足够的积分可以成为该区域的指定专家,并且还没有整体选择使用“指定专家”功能。 因为这意味着您可能会对相关知识不太自信,但会收到更多“ NQ”警报,因此删除“会员资料”中的新区域可能是一个好主意。
Let's just consider the effect the code as-is has on your received email if all is set up. How to do that will be shown later. I assume you have a single inbox folder dedicated for EE email, called "EE inbox", with no other mails around and no subfolders to consider.
如果设置全部,我们只考虑代码原样对您收到的电子邮件的影响。 稍后将显示如何执行此操作。 我假设您有一个专用于EE电子邮件的收件箱文件夹,称为“ EE收件箱” ,没有其他邮件,也没有要考虑的子文件夹。
Note: I will show the Tag column here in square brackets – just to visualize. In fact tags are not stored with square brackets.
注意:我将在此处在方括号中显示“标签”列-只是为了可视化。 实际上,标签没有用方括号存储。
The VBA code processes emails by:
VBA代码通过以下方式处理电子邮件:
matching the subject against a header (e.g. "Author Comment Added: ")
将主题与标题匹配(例如“添加的作者注释:”)
if found, remove it
如果找到,将其删除
if found, fill the Tag column ("[Author]")
如果找到,请填写标签列(“ [作者]”)
if found, search and remove mails not needed anymore ("Expert Alert: " resp. "[New]"), or delete this new mail if another email to be kept has been received already ("Comment Added: " resp. "[Expert]").
如果找到,请搜索并删除不再需要的邮件(“专家警报:”或“ [新]”),如果已经收到要保留的另一封电子邮件,则删除此新邮件(“添加的注释:”或“。” [专家]”)。
Applied to a simplified example:
应用于简化示例 :
21.12.2010 22:00:00 Neglected Question Alert: Example Question
21.12.2010 22:00:00被忽略的问题警报:示例问题
21.12.2010 22:00:00 [NQ] Example Question
21.12.2010 22:00:00 [NQ]示例问题
A more complex example – having heavy activity:
一个更复杂的例子 –活动繁重:
Let's assume we are contributing to a question with several other Experts, and there is a lot of traffic.
假设我们与其他几位专家一起提出了一个问题,并且流量很大。
21.12.2010 09:00:01 Expert Alert: Completely unrelated Question
21.12.2010 09:00:01专家警报:完全不相关的问题
21.12.2010 10:00:00 Comment Added: Why you should use EE
21.12.2010 10:00:00添加了评论:为什么您应该使用EE
21.12.2010 10:01:00 Author Comment Added: Why you should use EE
21.12.2010 10:01:00作者评论添加:为什么要使用EE
21.12.2010 10:01:30 Comment Added: Why you should use EE
21.12.2010 10:01:30发表评论:为什么要使用EE
21.12.2010 10:01:35 Comment Added: Why you should use EE
21.12.2010 10:01:35发表评论:为什么要使用EE
21.12.2010 10:05:00 Author Comment Added: Why you should use EE
21.12.2010 10:05:00作者注释添加:为什么您应该使用EE
21.12.2010 09:00:01 [New] Completely unrelated Question
21.12.2010 09:00:01 [New]完全不相关的问题
21.12.2010 10:00:00 [Expert] Why you should use EE
21.12.2010 10:00:00 [专家]为什么应使用EE
21.12.2010 10:01:00 [Author] Why you should use EE
21.12.2010 10:01:00 [作者]为什么应该使用EE
21.12.2010 10:01:30 [Expert] Why you should use EE
21.12.2010 10:01:30 [专家]为什么应该使用EE
21.12.2010 10:01:35 [Expert] Why you should use EE
21.12.2010 10:01:35 [专家]为什么应该使用EE
21.12.2010 10:05:00 [Author] Why you should use EE
21.12.2010 10:05:00 [作者]为什么要使用EE
21.12.2010 10:00:00 [Expert] Why you should use EE
21.12.2010 10:00:00 [专家]为什么应使用EE
21.12.2010 10:01:00 [Author] Why you should use EE
21.12.2010 10:01:00 [作者]为什么应该使用EE
If we change the constant optKeepOld to false (I'll show the code further below), we will see the most recent post of each type:
如果将常量optKeepOld更改为false (我将在下面进一步显示代码),我们将看到每种类型的最新文章:
21.12.2010 10:01:35 [Expert] Why you should use EE
21.12.2010 10:01:35 [专家]为什么应该使用EE
21.12.2010 10:05:00 [Author] Why you should use EE
21.12.2010 10:05:00 [作者]为什么要使用EE
22.12.2010 05:00:00 [P: 2,000 A] Why you should use EE [P: 2,000 A]
22.12.2010 05:00:00 [P:2,000 A]为什么应使用EE [P:2,000 A]
In case you do not get the "Good Answer" mail, but a "… will be closed …" instead, the unprocessed mail leaves this:
如果您没有收到“ Good Answer”邮件,但收到“…将被关闭……”的消息,则未处理的邮件将保留以下内容:
21.12.2010 10:01:35 [Expert] Why you should use EE
21.12.2010 10:01:35 [专家]为什么应该使用EE
21.12.2010 10:05:00 [Auhor] Why you should use EE
21.12.2010 10:05:00 [Auhor]为什么您应该使用EE
22.12.2010 05:00:00 A question you participated in will be closed in four days
22.12.2010 05:00:00您参加的问题将在四天内关闭
22.12.2010 05:00:00 [No pts] Why you should use EE
22.12.2010 05:00:00 [No pts]为什么您应该使用EE
The method used here requires you to have your EE specific mail dropped into a single, dedicated folder by creating a rule identifying it as such. If you do not separate your other mails from EE mails, they will get processed, which you might not want.
此处使用的方法要求您通过创建一个将其特定于EE的邮件拖放到一个专用文件夹中的规则。 如果您不将其他邮件与EE邮件分开,则会对它们进行处理,而这可能是您不希望的。
You can create rules based on the mail account (if you use a particular account), or the sender ([email protected]). Since I think it is pretty straight-forward to set up, I will leave it to you to figure it out ;-).
您可以基于邮件帐户(如果使用特定帐户)或发件人(
For the remainder of the article, I will call this folder "EE inbox". For testing purposes, you can setup a folder, and manually copy/move EE mails into it to see the result.
对于本文的其余部分,我将其称为“ EE收件箱”。 为了进行测试,您可以设置一个文件夹,然后手动将EE邮件复制/移动到该文件夹中以查看结果。
Import the code into the VBA Editor – press Alt-F11 to open that editor, open the "File" menu, and import the attached file (after renaming to *.cls).
将代码导入VBA编辑器–按Alt-F11打开该编辑器,打开“文件”菜单,然后导入附件(重命名为* .cls)。
Having created the rule, dedicated a folder for keeping EE mails, and importing the VBA code, you need to set a variable in the code to this folder. That folder is referenced in the Application_Startup macro, which contains code executed on startup of Outlook. I have provided three examples of how the complete path can look like:
创建规则,专用于保存EE邮件的文件夹并导入VBA代码后,您需要在代码中为此文件夹设置一个变量。 该文件夹在Application_Startup宏中引用,该宏包含在Outlook启动时执行的代码。 我提供了三个示例说明完整路径如何:
Public Sub Application_Startup()
' (1) Set myOlEEItems = Outlook.Session.GetDefaultFolder(olFolderInbox).Items
' (2) Set myOlEEItems = Outlook.Session.Folders("Mine").Folders("Inbox").Folders("EE").Items
' (3) Set myOlEEItems = Outlook.Session.Folders("EE inbox").Items
End Sub
(1) is your default inbox
(1)是您的默认收件箱
(2) shows an example for providing a folder deeper into a folder tree
(2)展示了一个提供更深入文件夹树的文件夹的示例
(3) uses an own PST file for EE
(3)将自己的PST文件用于EE
As soon as you have done that, you should call that macro – best just to position your cursor into it, and press F5.
完成此操作后,应立即调用该宏-最好只是将光标置于其中,然后按F5。
Nothing more to do! If you have set this up as your "live" environment, incoming emails will be processed automatically. If you used a test folder, just move or copy some mails into that folder, and view the result.
没事做! 如果您将其设置为“实时”环境,则将自动处理传入的电子邮件。 如果您使用了测试文件夹,只需将一些邮件移动或复制到该文件夹中,然后查看结果。
The VBA code consists of some subs and functions to make it easier to accommodate it to your needs. I will show and explain the code in logical units; for the complete code, see the attached class file.
VBA代码由一些子功能组成,可以更轻松地满足您的需求。 我将以逻辑单元显示和解释代码; 有关完整的代码,请参见附件的类文件。
Const optKeepOld = True ' true = always keep oldest mail; false = always keep recent
Public WithEvents myOlEEItems As Outlook.Items
Private Sub myOlEEItems_ItemAdd(ByVal item As Object)
Dim ml As MailItem
If TypeName(item) = "MailItem" Then
Set ml = item
If EESubj(ml, "[New] ", "Expert Alert: ") Then
ElseIf EESubj(ml, "[NQ] ", "Neglected Question Alert: ", "[New] ") Then
' ml.Body = ""
ElseIf EESubj(ml, "[Expert]", "Comment Added: ", " [New][NQ]") Then
If Not ml Is Nothing Then ml.FlagIcon = olGreenFlagIcon
ElseIf EESubj(ml, "[Author]", "Author Comment Added: ", " [New][NQ]") Then
If Not ml Is Nothing Then ml.FlagIcon = olGreenFlagIcon
ElseIf EESubj(ml, "[P: %Points% %Grade%]", "Good Answer! ", " [New][NQ][Expert][Author]") Then
' ml.Move ml.Parent.Folders("Archive")
ElseIf EESubj(ml, "[P: %Points% %Grade%]", "Good Assist! ", " [New][NQ][Expert][Author]") Then
' ml.Move ml.Parent.Folders("Archive")
ElseIf EESubj(ml, "[No pts] ", "Answer Accepted: ", " [New][NQ][Expert][Author]") Then
ElseIf EESubj(ml, "[No pts] ", "Points Split: ", " [New][NQ][Expert][Author]") Then
' this one catches both "deleted" and "closed" "in four days"
ElseIf EEBody(ml, "[No pts]", "A question you participated in will be ", "[New][NQ][Expert][Author]") Then
' important Article info:
ElseIf EEBody(ml, "[Edit]", "Please review your article") Then
ml.FlagIcon = olGreenFlagIcon
ElseIf EERank(ml) Then
End If
' Just to make sure all changes are saved ...
On Error Resume Next
ml.Save
On Error GoTo 0
End If
End Sub
myOlEEItems. myOlEEItems is not yet bound to anything; we first have to do that. To be precise, we need to associate it with an Outlook folder, which could also be a calendar, task, or any other folder type. However, we want it to be a mail folder. As already described, Application_Startup is associating the instance myOlEEItems to the folder, and the trigger is active.
myOlEEItems 。 myOlEEItems尚未绑定任何东西; 我们首先必须这样做。 确切地说,我们需要将其与Outlook文件夹关联,该文件夹也可以是日历,任务或任何其他文件夹类型。 但是,我们希望它是一个邮件文件夹。 如前所述, Application_Startup将实例myOlEEItems关联到该文件夹,并且触发器处于活动状态。
Coming back to the trigger code. As you have certainly seen it is "the core", where every action is initiated. First we make sure it is really a mail, and then we can apply our tests against it, by calling EESubj:
回到触发代码。 如您所见,它是“核心”,在其中启动所有操作。 首先,我们确保它确实是一封邮件,然后我们可以通过调用EESubj对它进行测试:
Private Function EESubj(ml As MailItem, tag As String, head As String, Optional DelTags As String) As Boolean
tag = Trim(Replace(Replace(tag, "[", ""), "]", ""))
Call ml.UserProperties.Add("Tag", olText)
' search only at the beginning, and exact match needed; if reprocessed, use stored tag
EESubj = (InStr(ml.Subject, head) = 1) Or ml.UserProperties("Tag") = tag
If EESubj Then
ml.Subject = Replace(ml.Subject, head, "")
If InStr(tag, "%") Then ' Further processing of the Body needed ...
tag = Replace(tag, "%Points%", "%Points%%NQPts%") ' Hack: There are two variants of point info ...
tag = Replace(tag, "%Points%", GetFromBody(ml, "Points Earned Per Zone: ", 5))
tag = Replace(tag, "%NQPts%", GetFromBody(ml, "Points Earned: ", 5))
tag = Replace(tag, "%Bonus%", GetFromBody(ml, "+ Bonus Points: ", 5))
tag = Replace(tag, "%Grade%", GetFromBody(ml, "Grade: ", 1))
' and we append the tag to the subject only in this cases ... - this is optional!
ml.Subject = ml.Subject & " [" & tag & "]"
End If
EESetRefInfo ml, tag
ml.Save
RemoveThread ml, DelTags
End If
End Function
removes the heading from the subject line
从主题行中删除标题
looks if we have a dynamic tag (containing a percent sign), and hence need some more parsing to fill out the template; in that case we append the resulting tag to the subject, in all other cases this is not done (automatically).
看看我们是否有一个动态标签(包含百分号),因此需要更多解析来填充模板; 在这种情况下,我们会将结果标签附加到主题上,而在所有其他情况下,则不会(自动)完成此操作。
sets all User Properties we need (done in
设置我们需要的所有用户属性(完成
EESetRefInfo) EESetRefInfo )takes care of removing this or any older email, if one with the same subject and any of the tags provided as forth parameter is found.
如果找到了主题相同且带有第四个参数提供的任何标签的邮件,则将删除该电子邮件或任何较旧的电子邮件。
returns true
返回true
Since the function returns a Boolean, you can do something like adding categories, moving to another folder, and so on. The code contains some examples.
由于该函数返回布尔值,因此您可以执行类似添加类别,移动到另一个文件夹等操作。 该代码包含一些示例。
You might have noticed that "%Points%", "%Bonus%" and "%Grade%" – that allows for inserting exactly that info, extracted from text found in the email body. Point info can have two appearances, either as "normal" points, or points with bonus from answering neglected questions. The wording in the body is different, and we do not know in advance if the email is about a neglected or "normal" question, so we have to parse for both.
您可能已经注意到,“%Points%”,“%Bonus%”和“%Grade%” –允许完全插入从电子邮件正文中找到的文本中提取的信息。 积分信息可以有两种显示形式,既可以作为“正常”积分,也可以通过回答被忽略的问题而获得加分。 正文中的措词是不同的,并且我们不预先知道电子邮件是否涉及被忽略或“正常”的问题,因此我们必须对两者进行解析。
Back to the trigger procedure. As we know, there are EE mails which do not contain anything about the subject matter in the subject line, like "Please review your article". To get those more informative, EEBody is called:
返回触发过程。 我们知道,有些EE邮件在主题行中未包含任何与主题有关的内容,例如“请查看您的文章”。 为了获得更多信息,我们将EEBody称为:
Private Function EEBody(ml As MailItem, tag As String, head As String, Optional DelTags As String) As Boolean
Dim link As String
tag = Trim(Replace(Replace(tag, "[", ""), "]", ""))
Call ml.UserProperties.Add("Tag", olText)
EEBody = (InStr(ml.Subject, head) = 1) Or ml.UserProperties("Tag") = tag
If EEBody Then
ml.Subject = GetFromBody(ml, "Article: ", 256) & GetFromBody(ml, "QUESTION: ", 256)
EESetRefInfo ml, tag
ml.Save
RemoveThread ml, DelTags
End If
End Function
EESubj, but retrieves the question or article title from the body. That works as long as we have unique identifying keywords, which is luckily the case – at the moment, at least.
EESubj ,但是从正文中检索问题或文章标题。 只要我们有唯一的识别关键字,这种方法就起作用了,幸运的是,至少目前如此。
The other function used the same way, EERank, is not that much different, so I will not show the code. The parsing is bit more tricky, as we need to extract partitial info out of sentences.
使用相同方法的另一个函数EERank并没有太大不同,因此我不会显示代码。 解析起来比较棘手,因为我们需要从句子中提取部分信息。
There are some more (helper) procedures and functions, which I won't show here, since their implementation is not of much interest. However, three key routines are located at the bottom of the file I provided. I'll only discuss them in short:
还有更多(帮助程序)过程和功能,在这里不再赘述,因为它们的实现没有太大意义。 但是,三个关键例程位于我提供的文件的底部。 我只会简短地讨论它们:
allows to go thru your EE inbox again in chronological order, or thru a list of selected mails, in case the trigger has not been run on all mails. That will occur if too many mails come in at once, or the VBA code has been halted due to an error message or a recent VBA code edit. It might be a good idea to dedicate a button in your toolbar to this macro.
如果触发器尚未在所有邮件上运行,则允许您按时间顺序再次遍历EE收件箱,或遍历所选邮件列表。 如果一次收到太多邮件,或者由于错误消息或最近对VBA代码进行了编辑而导致VBA代码已暂停,则会发生这种情况。 将工具栏中的按钮专用于此宏可能是一个好主意。
(see code below) uses the URL constructed on receive of the mail, and stored in one of the User Properties, to open that post in your default Web browser.
(请参见下面的代码)使用在接收邮件时构造并存储在用户属性之一中的URL在默认的Web浏览器中打开该帖子。
Public Sub EEJump2URL()
Dim item As Object
If TypeName(Outlook.ActiveWindow) = "Explorer" Then
Set item = Outlook.ActiveExplorer.Selection.item(1)
Else
Set item = Outlook.ActiveInspector.CurrentItem
End If
If TypeName(item) = "MailItem" Then
If item.UserProperties("URL") <> "" Then
Shell "cmd /c start " & item.UserProperties("URL")
End If
End If
End Sub
is almost the same as EEJump2URL, but deletes the email in the same go. Useful for the Author/Expert comment type mails.
与EEJump2URL几乎相同,但是会同时删除电子邮件。 对于作者/专家注释类型的邮件有用。
Further improvements, and tips for organizing better.
进一步的改进和更好的组织技巧。
The code supplied is far from being perfect. What makes it work is it being simple, and easily expandable. There is a lot I can imagine to be added or changed.
提供的代码远非完美。 使它起作用的原因在于它简单易扩展。 我可以想象有很多东西要添加或更改。
If you have different roles on EE, such as Expert and Page Editor, you might want to use separate folders for each role. As soon as you have understood how the code works, it should be easy to expand to using more than a single folder. The subroutines used are not bound to a particular folder, with exception of the trigger code, and I have already supplied an example trigger definition for using a separate folder for PE work.
I took care about being very flexible with the tags. For example, if you want not to differ between Author and Expert comments, just use the same tag for both. If you want to introduce or change tags – no problem.如果您在EE上具有不同的角色,例如专家和页面编辑器,则可能需要为每个角色使用单独的文件夹。 一旦您了解了代码的工作原理,应该很容易扩展为使用多个文件夹。 除触发器代码外,所使用的子例程未绑定到特定文件夹,并且我已经提供了示例触发器定义,用于将单独的文件夹用于PE工作。 我非常注意标签的灵活性。 例如,如果您不希望在Author和Expert注释之间有所区别,只需对二者使用相同的标记。 如果您想引入或更改标签-没问题。
Programmatically moving a post which will need to be considered later again (e.g. all New and NQ alerts in one folder, comments in another) are very difficult to handle. This is because the simple search feature used does support searching only in a single folder; the more sophisticated Advanced Search, which would allow for parsing subfolders, is asynchronous and way too complex to rectify its usage here.
以编程方式移动需要稍后再次考虑的帖子(例如,一个文件夹中的所有“新建”和“ NQ”警报,另一个文件夹中的注释)很难处理。 这是因为使用的简单搜索功能仅支持在单个文件夹中搜索; 更为高级的高级搜索(它可以解析子文件夹)是异步的,并且过于复杂,无法在此处纠正其用法。
To overcome the "single inbox folder" restriction, I use rules to assign color flags to different mail types. My NQ alerts are yellow, new questions are blue, aso. Then I have set up filter/search favourites for each of those, which allows me to look at new questions only, or work on comments first. Instead of filter favourites the grouping feature can be used – but expanding/collapsing is not that useful, IMO.
为了克服“单个收件箱文件夹”的限制,我使用规则将颜色标记分配给不同的邮件类型。 我的NQ警报为黄色,新问题为蓝色,也是如此。 然后,我为每个设置了过滤器/搜索收藏夹,这使我可以只查看新问题,或者先处理评论。 可以使用分组功能来代替过滤器收藏夹,但是IMO不能进行扩展/折叠。
Article and question comments are processed the same, and hence look the same – with one exception: The "Reference" user property start with an A instead of a Q. I use that by just showing the first letter of it in my Outlook views. The following screenshots show that using search favourites and custom views help much:
文章和问题注释的处理方式相同,因此外观相同–除了一个例外:“参考”用户属性以A而不是Q开头。 我通过在Outlook视图中显示它的第一个字母来使用它。 以下屏幕快照显示使用搜索收藏夹和自定义视图有很大帮助:
ThisOutlookSession.cls.txt ThisOutlookSession.cls.txt翻译自: https://www.experts-exchange.com/articles/3146/Reducing-EE-Email-Clutter-using-Outlook.html
outlook电子邮件解析