A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Create an E-mail using a Routine in VBA-MS-Access



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 13th 08, 10:16 PM posted to microsoft.public.outlook.program_vba
Guus
external usenet poster
 
Posts: 2
Default Create an E-mail using a Routine in VBA-MS-Access

Hello,
In Microsoft Access XP I have created a routine that creates an
e-mailmessage according to field in my Accessdatabase.
The address to whome the message has to be send will be filled
automatically, the Subject of the message will be filled automatically as
well.
So far so good.

But.....
The font used in the created message I prefere "Verdana 11pt"
On the moment I am not able to set this as well with my VBA-routine,
therefor I try to get some help here. Extra problem is, that another
submodule creates a table of Members at this course, and again another
submodule creates the signature.
All these information I want to be in the mail-message in A DEFAULT FONT
'Verdana 11'.

PLEASE TELL ME....Which VBA-sentences are missing in my VBA-module?

Private Sub cmdSelect_Click()
Dim Prog, Pad, Document, Soort As String

Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem

Call Shell(Prog, vbNormalFocus)

Set OutApp = CreateObject("Outlook.Application")
On Error GoTo OutlookError

Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "
.Subject = "Confirm your membership at our Course"
.HTMLBody = "HTML" & _
"Dear Madam/Sir,BRBR" & _
"This is a confirmation of your membership of our
workshop" & _
BRBR" & _
Signature 'will be created in
another routine
"/HTML"
.Display 'use .Display or .Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
End If
End Sub

Thank you in advance for helping me to set the default Font,
Guus

  #2  
Old June 14th 08, 06:27 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Create an E-mail using a Routine in VBA-MS-Access



You don't need to set the html tag. However, enclose all the text in a
div tag and use css:

div style='font-family:verdana, font-size:11pt;'....../div

If the sub modules use another font statement that you don't want to keep,
you need to remove that.

--
Best regards
Michael Bauer - MVP Outlook

: VBOffice Reporter for Data Analysis & Reporting
: Outlook Categories? Category Manager Is Your Tool:
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Fri, 13 Jun 2008 14:16:00 -0700 schrieb Guus:

Hello,
In Microsoft Access XP I have created a routine that creates an
e-mailmessage according to field in my Accessdatabase.
The address to whome the message has to be send will be filled
automatically, the Subject of the message will be filled automatically as
well.
So far so good.

But.....
The font used in the created message I prefere "Verdana 11pt"
On the moment I am not able to set this as well with my VBA-routine,
therefor I try to get some help here. Extra problem is, that another
submodule creates a table of Members at this course, and again another
submodule creates the signature.
All these information I want to be in the mail-message in A DEFAULT FONT
'Verdana 11'.

PLEASE TELL ME....Which VBA-sentences are missing in my VBA-module?

Private Sub cmdSelect_Click()
Dim Prog, Pad, Document, Soort As String

Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem

Call Shell(Prog, vbNormalFocus)

Set OutApp = CreateObject("Outlook.Application")
On Error GoTo OutlookError

Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "
.Subject = "Confirm your membership at our Course"
.HTMLBody = "HTML" & _
"Dear Madam/Sir,BRBR" & _
"This is a confirmation of your membership of

our
workshop" & _
BRBR" & _
Signature 'will be created in
another routine
"/HTML"
.Display 'use .Display or .Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
End If
End Sub

Thank you in advance for helping me to set the default Font,
Guus

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to: Create a routine which forwards email Ron Outlook and VBA 17 January 10th 07 09:05 PM
OUTLOOK 2007 - ACCESS CREATE MAIL AND MISSING OUTLOOK MAIL ADD-IN BLANK JUNK MAIL RECEIVED - CREATE RULE Outlook - Installation 0 July 17th 06 10:08 PM
terminate the routine if outlook is not available fitful_thought Outlook and VBA 2 April 27th 06 09:27 PM
terminate the routine if outlook is not available fitful_thought Outlook - General Queries 1 April 26th 06 02:01 PM
Excel macro to create e-mail in Outlook Web Access fitful_thought Outlook - General Queries 0 April 15th 06 10:23 AM


All times are GMT +1. The time now is 12:06 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.