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

  • Thread starter Thread starter Guus
  • Start date Start date
G

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 = "(e-mail address removed)"
.Subject = "Confirm your membership at our Course"
.HTMLBody = "<HTML>" & _
"Dear Madam/Sir,<BR><BR>" & _
"This is a confirmation of your membership of our
workshop" & _
<BR><BR>" & _
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
 
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:
 
Back
Top