将回复电子邮件格式化为 HTML

时间:2021-01-20 03:27:27

标签: html vba outlook formatting

我有一个付款通知 VBA,我用它来回复发送发票的原始电子邮件。我想在写电子邮件之前将回复转换为 HTML 格式,以便我的签名看起来正确。 我的代码是:

Sub PmntAdvice()
Dim xlApp As Excel.Application
 Set xlApp = Excel.Application
Dim Item As Outlook.MailItem
Dim oInspector As Inspector
Dim strSubject As String
Dim strBody As String
    
Set oInspector = Application.ActiveInspector
If oInspector Is Nothing Then
    Set Item = Application.ActiveExplorer.Selection.Item(1)
Else
   Set Item = oInspector.CurrentItem
End If

strBody = "To Accounts Section" & vbCr & vbCr & _
"We have paid the above account into your nominated bank account" & vbCr & vbCr & _
 "The attachment outlines the details of the payment" & vbCr & vbCr & _
"Please contact us if you wish to discuss this payment" & vbCr & vbCr & vbCr & _
"Regards" & vbCr & vbCr & _
"John"

strSubject = Item.Subject
strSubject = "Payment Advice"

' Set the message subject
Item.Subject = strSubject
Item.Body = strBody

Set Item = Nothing
Set oInspector = Nothing
End Sub

0 个答案:

没有答案