Сохраните файл шаблона с вашим текстом. В коде он сохраняется на диске C и называется NamePlaceholder.oft. Изменить по мере необходимости.
Откройте запрос перед запуском кода.
Sub CreateReplyFromTemplate() Dim currItem As Outlook.mailItem Dim currItemReply As Outlook.mailItem Dim myItem As Outlook.mailItem Dim commaPositionRight As Long Dim Firstname As String Set currItem = ActiveInspector.currentItem Set currItemReply = currItem.Reply Set myItem = Application.CreateItemFromTemplate("C:\NamePlaceholder.oft") myItem.To = currItemReply.To commaPositionRight = InStrRev(myItem.To, ",") Firstname = Right(myItem.To, commaPositionRight) myItem.Subject = currItem.Subject ' if "RE:" or "FW:" on the request, ' and the client replies there would be an extra "RE:" or "FW:" If InStr(myItem.Subject, "RE: ") = 1 Or InStr(myItem.Subject, "FW: ") = 1 Then myItem.Subject = Right(myItem.Subject, Len(myItem.Subject) - 4) End If myItem.HTMLBody = myItem.HTMLBody & currItemReply.HTMLBody myItem.HTMLBody = Replace(myItem.HTMLBody, "NAME", Firstname) currItemReply.Close olDiscard currItem.Close olDiscard myItem.Display Set currItemReply = Nothing Set myItem = Nothing Set currItem = Nothing End Sub
Если вы не знакомы с VBA, см. Здесь http://www.slipstick.com/developer/how-to-use-outlooks-vba-editor/