Setting Outlook Parameters in VBA

B

BillCPA

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?
 
B

BillCPA

All the answers I've seen refer to the signature - I have that part worked
out. But that doesn't give me the background and font I want.
 
J

JP

Try displaying the email first and then setting the Body property.

With olMail
.To = olToName
.cc = olccName
.Subject = olSubject
.Display
.Body = olBody
.Attachments.Add olAttach1
.Send
End With

--JP
 
B

BillCPA

Hadn't thought about that - certainly a solution - I'll probably try that for
now. Just seems like somebody would have wanted to do this before and
someone would have found out how.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top