1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Formatting text in an Email from Access

Discussion in 'Business Applications' started by Chris_E, Jul 19, 2007.

Thread Status:
Not open for further replies.
  1. Chris_E

    Chris_E Thread Starter

    Joined:
    Feb 16, 2006
    Messages:
    360
    I guess I'm trying to get too clever now...

    What method should I use to format the font/style of text in an email that is sent via MS Access?

    In HTML, I can f'rexample use <strong></strong>, in Word, I'd click "B" for bold. How would I apply the same feature to certain parts of text in my Access EMail sending application.

    Example:

    At the end of my emails, I want a disclaimer, but in small font rather than the default.

    Also, if I wanted to send the email as "Plain Text" rather than RTF or HTML, can I choose these in the automation process?

    Clear as mud?

    I bet!

    Chris
     
  2. jimr381

    jimr381

    Joined:
    Jul 20, 2007
    Messages:
    4,189
    First Name:
    Jim
    Are you using the export to an email option from MS Access via a macro? I forget the name offhand, but just wondering. Also when you format an e-mail message as plain text it will not allow you to add red color then, since it is plain text. ;)
     
  3. Chris_E

    Chris_E Thread Starter

    Joined:
    Feb 16, 2006
    Messages:
    360
    Hi Jim

    I'm not using a macro, I'm using a VB procedure that allows me more freedom to create the whole message.

    If it helps, here's the code slice I'm using:

    Code:
    Public Sub SendMail()
    
    ' Send Mail automation
    
    Dim dbs As DAO.Database
    Dim rst As DAO.Recordset
    Dim oLook As Object
    Dim oMail As Object
    Dim olns As Outlook.NameSpace
    
    
    Set dbs = CurrentDb
    Set rst = dbs.OpenRecordset("EmailAddList")
        
    rst.MoveFirst
    Do Until rst.EOF
    
    Set oLook = CreateObject("Outlook.Application")
    Set olns = oLook.GetNamespace("MAPI")
    Set oMail = oLook.createitem(0)
    With oMail
    .To = Me.EmailName.Value
    .body = Me.txtEmailMessageContent.Value
    .Subject = "Test Email"
    'Optional Attachment
    '.Attachments.Add (strInputFileName)
    .Send
    End With
    
    rst.MoveNext
    Loop
    rst.Close
    Set rst = Nothing
    dbs.Close
    Set dbs = Nothing
    Set oMail = Nothing
    Set oLook = Nothing
    
    
    End Sub
    I hoped I could provide wrap-round values to the section :

    Code:
    Set oLook = CreateObject("Outlook.Application")
    Set olns = oLook.GetNamespace("MAPI")
    Set oMail = oLook.createitem(0)
    then maybe I could define HTML style to define sections of the outbound Email... so far I've drawn a blank!

    Cheers

    Chris
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/597745

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice