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

design new mail from code in access



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 7th 07, 02:01 PM posted to microsoft.public.outlook.program_vba
rach
external usenet poster
 
Posts: 3
Default design new mail from code in access

hi,
i have this code:
Dim objOutlook As Outlook.Application
Dim objMail As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim db As Database
Dim msg As String

Set db = CurrentDb()
Set objOutlook = New Outlook.Application
Set objMail = objOutlook.CreateItem(olMailItem)
msg = "hello," & vbcrlf & "good morning""
With objMail
Set objOutlookRecip = .Recipients.Add(Email)
.Display
.Subject = "hello"
.Body = msg
end with


i want to align it (the body) to right to set the font, add a picture etc' ,
how can i design this mail?

Ads
  #2  
Old May 7th 07, 07:03 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default design new mail from code in access

Instead of using the Body property, set the HTMLBody property to the
appropriately formatted HTML string.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"rach" wrote in message
...
hi,
i have this code:
Dim objOutlook As Outlook.Application
Dim objMail As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim db As Database
Dim msg As String

Set db = CurrentDb()
Set objOutlook = New Outlook.Application
Set objMail = objOutlook.CreateItem(olMailItem)
msg = "hello," & vbcrlf & "good morning""
With objMail
Set objOutlookRecip = .Recipients.Add(Email)
.Display
.Subject = "hello"
.Body = msg
end with


i want to align it (the body) to right to set the font, add a picture
etc' ,
how can i design this mail?



 




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
Access Outlook from Word with VBA code Simon Minder Outlook and VBA 1 February 22nd 07 04:12 PM
Using Access to design a form and then publish it djb Outlook - General Queries 3 September 14th 06 06:22 PM
VBA Code to put in Access that will send an Email with Attachments [email protected] Outlook and VBA 1 April 9th 06 06:30 PM
Outlook not displaying attachment from Access via code [email protected] Outlook - General Queries 4 February 28th 06 12:30 AM
Code runs in design mode karlman Outlook - Using Forms 2 January 27th 06 06:49 PM


All times are GMT +1. The time now is 06:09 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.