Help needed saving a drat email in the local folder.

Mundsen

New Member
Joined
Aug 9, 2017
Messages
1
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=&quot]Sub C_Email()[/FONT]

[FONT=&quot] [/FONT]
[FONT=&quot] Dim OutApp As Object[/FONT]
[FONT=&quot] Dim OutMail As Object[/FONT]
[FONT=&quot] Dim strbody As String[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot] Set OutApp = CreateObject("Outlook.Application")[/FONT]
[FONT=&quot] Set OutMail = OutApp.CreateItem(0)[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot] With ThisWorkbook.Sheets("Lookup")[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot] strbody = "****** style=font-size:12pt;color:#40546A;font-family:Calibri>" & _[/FONT]
[FONT=&quot] .Range("B22") & vbNewLine & "<br><br>" & _[/FONT]
[FONT=&quot] .Range("B23") & vbNewLine & "<br><br>" & _[/FONT]
[FONT=&quot] .Range("B24") & vbNewLine & "<br><br>" & _[/FONT]
[FONT=&quot] .Range("B25") & vbNewLine & "<br>" & _[/FONT]
[FONT=&quot] Application.UserName[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot] On Error Resume Next[/FONT]
[FONT=&quot] [/FONT]

[FONT=&quot] With OutMail[/FONT]
[FONT=&quot] .Display[/FONT]
[FONT=&quot] .To = ThisWorkbook.Sheets("Lookup").Range("B7").Value[/FONT]
[FONT=&quot] .CC = ""[/FONT]
[FONT=&quot] .BCC = ""[/FONT]
[FONT=&quot] .Subject = ThisWorkbook.Sheets("Lookup").Range("B3").Value[/FONT]
[FONT=&quot] .HTMLBody = strbody & "<br>" & .HTMLBody[/FONT]
[FONT=&quot] .Display[/FONT]
[FONT=&quot] .Importance = 2[/FONT]
[FONT=&quot] .Attachments.Add[/FONT]

[FONT=&quot] [/FONT]
[FONT=&quot] End With

End Sub
[/FONT]
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,215,523
Messages
6,125,320
Members
449,218
Latest member
Excel Master

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top