Untitled
unknown
plain_text
a year ago
973 B
6
Indexable
' Replace placeholders in the letter template with dynamic data
With wordDoc.Content.Find
.Text = "<Date>"
.Replacement.Text = dateStr
.Execute Replace:=wdReplaceAll
If .Found = False Then
MsgBox "Error: Placeholder <Date> not found.", vbExclamation
End If
.Text = "<RecipientName>"
.Replacement.Text = recipientName
.Execute Replace:=wdReplaceAll
If .Found = False Then
MsgBox "Error: Placeholder <RecipientName> not found.", vbExclamation
End If
.Text = "<Address>"
.Replacement.Text = recipientAddress
.Execute Replace:=wdReplaceAll
If .Found = False Then
MsgBox "Error: Placeholder <Address> not found.", vbExclamation
End If
.Text = "<APEAmount>"
.Replacement.Text = apeAmount
.Execute Replace:=wdReplaceAll
If .Found = False Then
MsgBox "Error: Placeholder <APEAmount> not found.", vbExclamation
End If
End WithEditor is loading...
Leave a Comment