Archive for July, 2009
公务猿呼啸下江南
Outlook Tips For You
Rule is powerful tool to help you organize your email in Outlook, but sometimes, it still doesn’t meet your expectation, so anything else you could do? just wait Microsoft to add more features in next release of Outlook? I guess this isn’t what you expected. If you’re familiar with VBA, use Macro instead of Rule, because of the flexibility of VBA, you can hack it and custom it as you wish, I believe you’ll find out more advanced features of Outlook, even if you’re a newbie of VBA, it’s okay, VBA is not designed for geeks in the first place, you could get how to use it in several minutes, below is an example:
Sub BackupSentMail()
Set OutApp = CreateObject("Outlook.Application")
Set NmSpace = OutApp.GetNamespace("MAPI")
Set BackupSent = NmSpace.Folders("Sent").Folders("ALL")
Set DefaultSent = NmSpace.GetDefaultFolder(5)
For intX = DefaultSent.Items.Count To 1 Step -1
Set objMessage = DefaultSent.Items.Item(intX)
objMessage.Move BackupSent
Next
Set OutApp = Nothing
Set NmSpace = Nothing
Set BackupSent = Nothing
Set DefaultSent = Nothing
End Sub
Sub CustomMailMessageRule(Item As Outlook.MailItem)
Set OutApp = CreateObject("Outlook.Application")
Set NmSpace = OutApp.GetNamespace("MAPI")
Set folderOnlyToMe = NmSpace.Folders("Main").Folders("OnlyToMe")
Set folderTrash = NmSpace.Folders("Main").Folders("Trash")
Set folderSWS = NmSpace.Folders("SWS").Folders("ALL")
Set folderIntegration = NmSpace.Folders("Integration").Folders("ALL")
Set folderIntegrationDev = NmSpace.Folders("Integration").Folders("Dev.")
Set folderIncoming = NmSpace.Folders("Main").Folders("Incoming")
”””””””””””””””’
‘ Set Flag
”””””””””””””””’
‘ Sent by bosses
If Item.SenderName = "Gates, Bill" Or _
Item.SenderName = "Jackson, Michael" Or _
Item.SenderName = "Jong, John" Then
Item.FlagStatus = olFlagMarked
Item.FlagIcon = olOrangeFlagIcon
Item.Save
MsgBox Item.Subject, vbInformation, "Here comes a new msg"
End If
”””””””””””””””’
‘ Trash Filter
”””””””””””””””’
If Item.SenderEmailAddress = "hqadmin@antispam.charry.org" Or _
Item.SenderEmailAddress = "OPN_validation_system@antispam.charry.org" Or _
Item.SenderEmailAddress = "MES_AUTO_LOT_HOLD@antispam.charry.org" Or _
Item.SenderEmailAddress = "MTEPP_Detection_System@antispam.charry.org" Or _
Item.SenderEmailAddress = "szcpp113@antispam.charry.org" Or _
Item.SenderEmailAddress = "szcpp111@antispam.charry.org" Or _
Item.SenderEmailAddress = "szcpp233@antispam.charry.org" Or _
Item.SenderEmailAddress = "szcpp231@antispam.charry.org" Or _
Item.SenderEmailAddress = "yammer@yammer.com" Or _
Item.SenderEmailAddress = "Unfuse_units_detection_system@antispam.charry.org" Then
Item.Move folderTrash
GoTo CleanUp
End If
If Item.To = "fbdaemon@szasptgh101.amd.com" Then
Item.Move folderTrash
GoTo CleanUp
End If
‘ SVN_INTDEV
If InStr(Item.SenderEmailAddress, "@soulcutter.amd.com") > 0 Then
Item.Move folderTrash
GoTo CleanUp
End If
‘ EDA Daily Report
If Item.SenderEmailAddress = "The_Software_Services_Team@antispam.charry.org" Then
Item.Move NmSpace.Folders("Misc").Folders("EDA Report")
GoTo CleanUp
End If
‘ Title Filter
If InStr(Item.Subject, "ex-factory utilization report") > 0 Then
Item.Move folderTrash
GoTo CleanUp
End If
”””””””””””””””’
‘ Normal Filter
”””””””””””””””’
‘ to me
MyPos = InStr(Item.To, "Charry")
If MyPos > 0 Then
Item.Move folderOnlyToMe
GoTo CleanUp
End If
‘ cc me
MyPos = InStr(Item.CC, "Charry")
If MyPos > 0 Then
Item.Move folderOnlyToMe
GoTo CleanUp
End If
‘ to dl.suz_sws
MyPos = InStr(Item.To, "dl.suz_sws")
If MyPos > 0 Then
Item.Move folderSWS
GoTo CleanUp
End If
‘ cc dl.suz_sws
MyPos = InStr(Item.CC, "dl.suz_sws")
If MyPos > 0 Then
Item.Move folderSWS
GoTo CleanUp
End If
‘ GMail
If Item.To = "hi@antispamp.charry.org" Or Item.To = "charrywong@ggggggmail.com" Then
Item.Move NmSpace.Folders("Misc").Folders("charry.org")
GoTo CleanUp
End If
Item.Move folderIncoming
CleanUp:
Set OutApp = Nothing
Set NmSpace = Nothing
Set folderOnlyToMe = Nothing
Set folderTrash = Nothing
Set folderSWS = Nothing
Set folderIntegration = Nothing
End Sub
Sub CustomMeetingRequestRule(Item As Outlook.MeetingItem)
MsgBox "Meeting request arrived: " & Item.Subject
End Sub
How do we activate the code above? first of all, you should create a macro in Visual Basic Editor(press ALT+F11 to call this editor), afterwards, paste the code above to the editor and save, then you need to create a rule and make the rule applies to all emails(there’s a time span option in wizard, you could set the new rule for all email received before year 2099), then you’ll see an option to let you run a script when you received an email, the following steps are straightforward.
The code snippet I posted here is just a reference, Google VBA+Outlook, you will get more examples. Focus on the email itself rather than organizing email. See, you’re just one step away from an effective and efficient working way.
多事之秋-2009
新疆又出事了,所以不出意外的,Twitter又挂了,Facebook也挂了。连翡翠台(Pearl)之News at 7:30刚播放关于新疆的新闻1-2分钟后,画面突然被插入香港卫生署的公益广告,很生硬,切换回来的时候,相关的新闻已经播完了。
Why Richard Stallman always vote against Microsoft
引子:Stallman warns of Mono ‘risk’
Richard Stallman是个在IT界是个响当当的名人,不夸张的说,他的出现是对UNIX文化的一个巨大的贡献。他最大的影响是在自由软件运动方面,创立了Free Software Foundation,GNU,同时也是个黑客、一个理想主义者,且在我看来,他还有些偏执狂。
![]()
相信很多了解Richard Stallman(以下简称rms)的人,包括我,都会以仰角45度的方式来看待他。他是个不折不扣的牛人,比如他编写了emacs、gcc、gdb、GNU make这些经典的开发工具,每一款都可谓是个重量级的作品。相信Bill Gates也对他尊敬有加。
天才行事往往异于常人,rms不爱运动,着装朴素,一个典型的geek。工作上很难和同事相处,不管是从技术上,还是人际关系,他总是和别人格格不入(援引维基百科词条)。
他创立了copyleft这个概念,它抵制一切版权相关的东西,他认为自由软件才是软件业发展的最终方向,诸如微软这样的厂商是对软件发展的阻碍,限制了用户的自由。
关于什么是自由软件,Google一下,不难找到它的定义,你也可以听rms本人的亲口定义:http://www.youtube.com/watch?v=uJi2rkHiNqg。一个不恰当的比喻,他有点像在推行软件业中的共产主义,愿景是如此的美好,可未必真的人人原意这样。
非自由软件的典型代表就是微软,也是rms的抨击对象,他反对微软的DRM(DefectiveByDesign.org),反对微软的Word规范(Campaign for OpenDocument),反对Vista,还有如前面提到的,他反对开源社区将.NET移植到Linux上,等等。
对于rms描绘的美好蓝图,没有人会说他有什么不好,问题是软件业也是360行中的一行,你不能奢望它能在短时间内达到‘自由’的境界,就像我们不能要求图书出版业也‘自由’一样,这个比较还是不恰当,但我想你懂我的意思。我也赞成自由软件,但是我不赞成过度的要求,对于那些闭源软件、专有协议等有违copyleft概念的东西,我们的不需如此的横眉冷对,完全可以共创一个和谐社会。企业有权利保留自己的私有代码、专有格式,赚钱是它们最根本的出发点,它们不是研究所,不是慈善机构。让每个企业都如Richard般的伟大,实在有些强人所难。
第一行提到的Mono,本来是一些热心人士(Novell)好心将.NET移植到Linux平台,rms却发布文章批评Debian不该这么做。即使Novell不这么做,总会有人去做。
有句话如是说:一切可能出现的东西,它一定会出现。
总结:美国人不懂什么叫“和谐社会”,所以有了Richard Stallman。