Hi,
So far I have been able to generate an email off the back of an Excel spreadsheet. My plan was to then save a draft of this email in the local folder so that it can be used by another user. Unfortunately I have hit a wall on this, so here I am!
Copy of the VBA code can be found below.
Any guidance would be massively appreciated!
Thanks!
---
[FONT="]Sub C_Email()[/FONT]
[FONT="] [/FONT]
[FONT="] Dim OutApp As Object[/FONT]
[FONT="] Dim OutMail As Object[/FONT]
[FONT="] Dim strbody As String[/FONT]
[FONT="] [/FONT]
[FONT="] Set OutApp = CreateObject("Outlook.Application")[/FONT]
[FONT="] Set OutMail = OutApp.CreateItem(0)[/FONT]
[FONT="] [/FONT]
[FONT="] With ThisWorkbook.Sheets("Lookup")[/FONT]
[FONT="] [/FONT]
[FONT="] strbody = "****** style=font-size:12pt;color:#40546A;font-family:Calibri>" & _[/FONT]
[FONT="] .Range("B22") & vbNewLine & "<br><br>" & _[/FONT]
[FONT="] .Range("B23") & vbNewLine & "<br><br>" & _[/FONT]
[FONT="] .Range("B24") & vbNewLine & "<br><br>" & _[/FONT]
[FONT="] .Range("B25") & vbNewLine & "<br>" & _[/FONT]
[FONT="] Application.UserName[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] On Error Resume Next[/FONT]
[FONT="] [/FONT]
[FONT="] With OutMail[/FONT]
[FONT="] .Display[/FONT]
[FONT="] .To = ThisWorkbook.Sheets("Lookup").Range("B7").Value[/FONT]
[FONT="] .CC = ""[/FONT]
[FONT="] .BCC = ""[/FONT]
[FONT="] .Subject = ThisWorkbook.Sheets("Lookup").Range("B3").Value[/FONT]
[FONT="] .HTMLBody = strbody & "<br>" & .HTMLBody[/FONT]
[FONT="] .Display[/FONT]
[FONT="] .Importance = 2[/FONT]
[FONT="] .Attachments.Add[/FONT]
[FONT="] [/FONT]
[FONT="] End With
End Sub
[/FONT]
So far I have been able to generate an email off the back of an Excel spreadsheet. My plan was to then save a draft of this email in the local folder so that it can be used by another user. Unfortunately I have hit a wall on this, so here I am!
Copy of the VBA code can be found below.
Any guidance would be massively appreciated!
Thanks!
---
[FONT="]Sub C_Email()[/FONT]
[FONT="] [/FONT]
[FONT="] Dim OutApp As Object[/FONT]
[FONT="] Dim OutMail As Object[/FONT]
[FONT="] Dim strbody As String[/FONT]
[FONT="] [/FONT]
[FONT="] Set OutApp = CreateObject("Outlook.Application")[/FONT]
[FONT="] Set OutMail = OutApp.CreateItem(0)[/FONT]
[FONT="] [/FONT]
[FONT="] With ThisWorkbook.Sheets("Lookup")[/FONT]
[FONT="] [/FONT]
[FONT="] strbody = "****** style=font-size:12pt;color:#40546A;font-family:Calibri>" & _[/FONT]
[FONT="] .Range("B22") & vbNewLine & "<br><br>" & _[/FONT]
[FONT="] .Range("B23") & vbNewLine & "<br><br>" & _[/FONT]
[FONT="] .Range("B24") & vbNewLine & "<br><br>" & _[/FONT]
[FONT="] .Range("B25") & vbNewLine & "<br>" & _[/FONT]
[FONT="] Application.UserName[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="] On Error Resume Next[/FONT]
[FONT="] [/FONT]
[FONT="] With OutMail[/FONT]
[FONT="] .Display[/FONT]
[FONT="] .To = ThisWorkbook.Sheets("Lookup").Range("B7").Value[/FONT]
[FONT="] .CC = ""[/FONT]
[FONT="] .BCC = ""[/FONT]
[FONT="] .Subject = ThisWorkbook.Sheets("Lookup").Range("B3").Value[/FONT]
[FONT="] .HTMLBody = strbody & "<br>" & .HTMLBody[/FONT]
[FONT="] .Display[/FONT]
[FONT="] .Importance = 2[/FONT]
[FONT="] .Attachments.Add[/FONT]
[FONT="] [/FONT]
[FONT="] End With
End Sub
[/FONT]