用于向主题行添加名称的宏(Outlook 2010和2007) [英] Macro for Adding Name to Subject Line (Outlook 2010 and 2007)
问题描述
我想编写一个宏,将特定单词添加到Outlook中现有电子邮件的主题行。例如,如果电子邮件的当前主题行是"发票123"。我希望能够点击宏并让主题
更改为"Scott-Invoice 123"。这可能吗?
谢谢!
怎么样
Sub ChangeSubject()
Dim strSubject As String
Dim olMail As MailItem
On Error GoTo ErrHandler
如果TypeName(ActiveWindow)=" Inspector"然后
如果ActiveInspector.IsWordMail则为
设置olMail = ActiveInspector.CurrentItem
strSubject = olMail.Subject
olMail.Subject =" Scott-" &安培; strSubject
结束如果
结束如果
退出Sub¥
ErrHandler:
哔哔声
结束子
I would like to write a macro that adds a specific word to a subject line of an existing email in Outlook. For example, if the current subject line of an email is, "Invoice 123". I want to then be able to click on the Macro and have the subject
change to, "Scott-Invoice 123". Is that possible?
Thanks!
How about
Sub ChangeSubject()
Dim strSubject As String
Dim olMail As MailItem
On Error GoTo ErrHandler
If TypeName(ActiveWindow) = "Inspector" Then
If ActiveInspector.IsWordMail Then
Set olMail = ActiveInspector.CurrentItem
strSubject = olMail.Subject
olMail.Subject = "Scott-" & strSubject
End If
End If
Exit Sub
ErrHandler:
Beep
End Sub
这篇关于用于向主题行添加名称的宏(Outlook 2010和2007)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!