ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Get Outlook Settings for E-Mail from Excel (https://www.excelbanter.com/excel-programming/438768-get-outlook-settings-e-mail-excel.html)

BillCPA

Get Outlook Settings for E-Mail from Excel
 
I am using the following code to send e-mail through Outlook from Excel.

SigString = "C:\Documents and Settings\...\Signatures\Bill.txt"
If Dir(SigString) < "" Then
Signature = GetBoiler(SigString)
Else
Signature = ""
End If
olBody="xxxemailmessagexxx" & Signature
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = olToName
.cc = olccName
.Subject = olSubject
.Body = olBody
.Attachments.Add olAttach1
.Send
End With

My regular Outlook layout has a blue background plus some paragraph
formatting - this sends the message with no background, and I have to insert
vbCrLf to get the paragraph formatting I want. Is there some way to pick up
my standard Outlook e-mail settings?

Also, I got the 'GetBoiler' code from the web - is there something newer
now? It displays an error message with that, but goes ahead and sends the
e-mails.

--
Bill @ UAMS

Barb Reinhardt

Get Outlook Settings for E-Mail from Excel
 
I don't use this often, but I seem to remember seeing an HTML option for
Body. You may want to research that a bit.
--
HTH,

Barb Reinhardt



"BillCPA" wrote:

I am using the following code to send e-mail through Outlook from Excel.

SigString = "C:\Documents and Settings\...\Signatures\Bill.txt"
If Dir(SigString) < "" Then
Signature = GetBoiler(SigString)
Else
Signature = ""
End If
olBody="xxxemailmessagexxx" & Signature
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = olToName
.cc = olccName
.Subject = olSubject
.Body = olBody
.Attachments.Add olAttach1
.Send
End With

My regular Outlook layout has a blue background plus some paragraph
formatting - this sends the message with no background, and I have to insert
vbCrLf to get the paragraph formatting I want. Is there some way to pick up
my standard Outlook e-mail settings?

Also, I got the 'GetBoiler' code from the web - is there something newer
now? It displays an error message with that, but goes ahead and sends the
e-mails.

--
Bill @ UAMS



All times are GMT +1. The time now is 09:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com