Setting Outlook Parameters in VBA

Status
Not open for further replies.
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?

Bill @ UAMS
 
What's with the answers you've already received for this question? Have you

read them?

Best regards

Michael Bauer

Am Sat, 23 Jan 2010 09:40:04 -0800 schrieb 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?
 
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.

Bill @ UAMS

"Michael Bauer " wrote:



> What's with the answers you've already received for this question? Have you
> read them?

> > Best regards
> Michael Bauer
>

>

> Am Sat, 23 Jan 2010 09:40:04 -0800 schrieb 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?

> .
>
 
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

On Jan 23, 12:40 pm, BillCPA <Bill @ UAMS> 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?

> > Bill @ UAMS
 
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.

Bill @ UAMS

"JP" wrote:


> 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

> On Jan 23, 12:40 pm, BillCPA <Bill @ UAMS> 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?
> > > > Bill @ UAMS

> .
>
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
AlphonseG Outlook 365 Outlook Crashes on setting SaveSentMessageFolder Outlook VBA and Custom Forms 4
R Outlook 2021 Having problem setting up outlook 2021 with windows 11. I have 3 gmail accounts and I want the 3 gmail, emails to merge into the same outlook input. Using Outlook.com accounts in Outlook 0
e_a_g_l_e_p_i Outlook 2010 Help setting up Gmail account in Outlook 2010 Using Outlook 3
Marc2019 Setting up an Outlook Account on Mac Os 10.6.8 Outlook 2011 Using Outlook 1
L Outlook Office 365 client: won't remember my setting File, not to collapse ribbon Using Outlook 2
C iCloud Setting missing Outlook tab and Outlook missing the iCloud refresh button Using Outlook 4
C need help setting up outlook first time Using Outlook 1
Ed Sheehan Unusual behaviour in setting Sender (Outlook 2016) Outlook VBA and Custom Forms 4
Diane Poremsky Setting up an Outlook.com IMAP account Using Outlook 0
Diane Poremsky Setting the default Country for Outlook Contacts Using Outlook 0
Diane Poremsky Adjusting Outlook's Zoom setting in Email Using Outlook 0
B Outlook Calendar/setting appointments Using Outlook 1
Diane Poremsky Adjusting Outlook's Zoom setting in Email Using Outlook 0
A Can't stop Outlook.com from setting reminders on appointments? Using Outlook.com accounts in Outlook 3
A Setting RULES with more than one condition in MS OUTLOOK Using Outlook 6
L Setting up my PA's Outlook Using Outlook 7
S Setting up Outlook 2010 to work with custom domain outlook.com account BCM (Business Contact Manager) 3
K Help Needed - setting up Email in Outlook 2013 Using Outlook 3
D How do I start completely from scratch in setting up Outlook 2013? Using Outlook 6
C Setting up Outlook 10 on Widows 8 using Google Server Using Outlook 3
I Outlook Appointments - Setting default text in message body Using Outlook 3
J Outlook 2010 - email address disappears when setting up new contact Using Outlook 0
V Setting up Outlook 2013 for AOL (POP3) Account Using Outlook 16
V Setting up windows 7 & outlook 2007 w/ Iphone 4 & synch contacts & calendar Using Outlook 9
C starting Outlook 2003 sp3 sets Junk Email setting to 'No automatic filtering' Using Outlook 3
M setting up 2 separate businesses in Outlook 2010 Using Outlook 2
D Outlook 2010 - email address disappears when setting up new contact Using Outlook 3
S Outlook 2003: Help with setting up a macro to reply to selected emails Using Outlook 2
S Trouble setting up Outlook Connector to sync with windows live Using Outlook.com accounts in Outlook 3
P Setting Hotmail Junk Mail Settings from Outlook Doesn't Work Using Outlook.com accounts in Outlook 1
J Outlook Appointment recurrence setting Outlook VBA and Custom Forms 4
P Setting combobox properties from Outlook 2007 Add-in Outlook VBA and Custom Forms 9
T Outlook setting through code(in >tools >options) Outlook VBA and Custom Forms 1
R Anyone have a sample macro for Outlook 2007 (setting the zoom)? Outlook VBA and Custom Forms 1
S Question of setting the order of a custom menu in Outlook Outlook VBA and Custom Forms 1
P OWA Settings->Calendar->Events from Email; Setting changes do not hold Using Outlook 1
M Where is the setting to *turn off* open calendar in a new window? Using Outlook 3
llama_thumper Setting up forwarders on Exchange server Exchange Server Administration 0
B Setting rules Using Outlook 1
B Setting defaults Using Outlook 2
P Reading Pane (Reading Pain?) Default Setting Using Outlook 1
W Setting up a custom form Outlook VBA and Custom Forms 2
mctabish Setting "Reply To" based on inbox Outlook VBA and Custom Forms 2
R Setting font and color used when replying to an email Outlook VBA and Custom Forms 3
M Setting flag follow up for next business day Outlook VBA and Custom Forms 1
Jennifer Murphy Equations don't comply with style setting to left justify Using Outlook 0
J Setting default address book Using Outlook 0
N Does a Shared Folder Policy override a Digital Signature Setting for macros? Outlook VBA and Custom Forms 6
H Need help setting up GetFolderPath-Makro with Vodafone IMAP Mail-Account Outlook VBA and Custom Forms 0
O Setting default format for composing/replying to emails Using Outlook 3

Similar threads

Back
Top