Pinaceous
Well-known Member
- Joined
- Jun 11, 2014
- Messages
- 1,124
- Office Version
- 365
- Platform
- Windows
Hi All,
I'm using this code that I've come up with on a previous post and it works really very nicely.
https://www.mrexcel.com/forum/excel-questions/1037579-vba-send-email-attachment-question.html
If you take a look at the code, I have the OutMail referencing a cell to gain the information that I need to post inside the email.
So, My question is, 'How do I change the OutMail font?
For example, Can I reference a word document as to be used as template for my OutMail message??
Please let me know, what are your thoughts hopefully expressed in code.
Thank you!
Pinaceous
I'm using this code that I've come up with on a previous post and it works really very nicely.
https://www.mrexcel.com/forum/excel-questions/1037579-vba-send-email-attachment-question.html
If you take a look at the code, I have the OutMail referencing a cell to gain the information that I need to post inside the email.
So, My question is, 'How do I change the OutMail font?
For example, Can I reference a word document as to be used as template for my OutMail message??
Code:
Option Explicit
Sub sendemail()
Dim FileExtStr As String:confused:
Dim FileFormatNum As Long
Dim Sourcewb As Workbook
Dim Destwb As Workbook
Dim TempFilePath As String
Dim TempFileName As String
Dim OutApp As Object
Dim OutMail As Object
Dim varMyAttachment As Variant
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = Worksheets("admin").Range("f9").Value
.CC = Worksheets("admin").Range("f10").Value
.BCC = ""
.Subject = Worksheets("admin").Range("i11").Value
.Body = Worksheets("admin").Range("[B]i[B]12[/B]"[/B]).Value
'For a single file:
.Attachments.Add ("C:\File1.xlsb")
'For multiple files:
For Each varMyAttachment In Array("C:\File1.xlsb", "C:\File2.xlsb")
.Attachments.Add varMyAttachment
Next varMyAttachment
.Display
End With
End Sub
Please let me know, what are your thoughts hopefully expressed in code.
Thank you!
Pinaceous
Last edited: