Happy Friday! I'm looking for a way to send mass emails using outlook email template (.oft) as body of the email since using information from the text box ruins the formatting.
Below is the code I'm working on.
Thank you.
Expand|Select|Wrap|Line Numbers
- Private Sub btn_send_Click()
- Dim olApp As Object
- Dim objMail As Object
- Dim Issue As String
- strIssue = Me.txt_body
- On Error Resume Next 'Keep going if there is an error
- Set olApp = GetObject(, "Outlook.Application") 'See if Outlook is open
- If Err Then 'Outlook is not open
- Set olApp = CreateObject("Outlook.Application") 'Create a new instance
- End If
- 'Create e-mail item
- Set objMail = olApp.CreateItem(olMailItem)
- With objMail
- .To = "XXXX@XXX.com"
- .Subject = "Form issue"
- .Body = strIssue & txt_sign
- .send
- End With
- MsgBox "Operation completed successfully"
- End Sub
Thanks a lot for the help.