我有一个MIS,可以为工作说明生成自动电子邮件。但是我操纵了水晶报告以作出订单确认,并想用"Work Instruction '1234' 'date' etc"
"Order Acknowledgement '1234' 'date' etc".
的SUBJECT中的单词。
我想点击我添加到'撰写电子邮件'屏幕的宏按钮来执行此操作
这是我尝试过的,目前无效。
Sub OrderAck()
Dim OrdAck As String
Dim NewMail As Outlook.MailItem
Set NewMail = Application.ActiveInspector.CurrentItem
OrdAck = Replace(NewMail.Subject, "Works Instruction", "Order Acknowledgement")
NewMail.Subject = OrdAck
NewMail.Subject = Display
End Sub
答案 0 :(得分:0)
要编辑主题行,请尝试以下
Option Explicit
Sub OrderAck()
Dim olItem As Object
Dim OrdAck As String
Dim sNew As String
Dim NewMail As Outlook.Application
Set NewMail = Application
Set olItem = NewMail.ActiveExplorer.Selection.Item(1)
OrdAck = Replace(olItem.Subject, "Works Instruction", "Order Acknowledgement")
sNew = OrdAck
olItem.Subject = sNew
olItem.Save
End Sub