我女朋友做hr工作,有一次幫她篩簡歷,只要沒有英文簡歷的就需要發(fā)郵件要,有英文簡歷的就發(fā)一個(gè)簡單的通知。看起來挺簡單,好,第一步,先把沒有英文簡歷的郵件標(biāo)上藍(lán)旗,有英文簡歷的標(biāo)對號,第二步,分別集體回復(fù)藍(lán)旗和對號的郵件。可作完第一步才發(fā)現(xiàn)outlook 中只有reply all 而沒有可選郵件回復(fù),無奈,手工回復(fù)了所有的郵件,等發(fā)完三十封之后,已經(jīng)氣喘噓噓了。一氣之下,決定作一個(gè)可以群體恢復(fù)的控件。
需求: 選中若干郵件,點(diǎn)擊按鈕,新建郵件并將選中郵件的發(fā)件人地址自動(dòng)添加到收件人項(xiàng)目中。
編程工具:outlook 綁定的visual basic 宏編輯器()
1,打開編輯器
寫入代碼:
Sub ReplyMessage_version02()
Dim msg As Outlook.MailItem
Set msg = Application.CreateItem(olMailItem)
msg.Subject = "Ethos"
msg.To = GetAddressFromSelection()
msg.Display
End Sub
Function GetAddressFromSelection()
Dim myOlSel As Outlook.Selection
Dim x As Integer
adresses = ""
Set myOlSel = Application.ActiveExplorer.Selection
For x = 1 To myOlSel.Count
adresses = adresses & myOlSel.Item(x).SenderEmailAddress & ";"
Next x
GetAddressFromSelection = adresses
End Function
End Sub
2, 好,這時(shí)就可以選中郵件運(yùn)行宏命令了。為了方便可以在工具欄編輯按鈕來調(diào)用命令。
這次為了方便采用的outlook綁定vb, 有時(shí)間再嘗試C++,c# :)
Reference:http://outlookcode.com