Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003

    Unanswered: DoCmd.SendObject - Changing Body Text color


    How would I change the color of the body (body text if you want it) of the syntax below to a red font?

    DoCmd.SendObject acSendNoObject, "test", ,, , , "your subject here", "body text if you want it"

    Can someone please help me?

  2. #2
    Join Date
    Feb 2004
    Dorset UK
    Yes you can..BUT !!!

    Its a tad more complex

    Set myOlApp = CreateObject("Outlook.Application")
    Set myitem = myOlApp.CreateItem(olMailItem)
    Set myRecipient = myitem.Recipients.Add("")

    Set myAttachments = myitem.Attachments
    myAttachments.Add "C:\your\file\here.xls"

    myitem.Subject = "Nice title"

    Msg = Chr(13) & "Hi," & Chr(13) & Chr(13)

    myitem.HTMLBody = "<font size = 7 COLOR=#0000FF FACE=Arial>" & "Blah" & "<font size = 3 COLOR=#FF0000 FACE=Arial>" & "blah" & "<font size = 5 COLOR=#00FF00 FACE=roman>" & " blah" & Chr(13) & Chr(13) & "Regards"

    myitem.Display '<-- change to myitem.send (if you want to send without preview)

    This code uses the HTMLBODY, you'll see that instead of the RGB colour it uses Color=#FF0000 The first 2 of the 6 digits are Red, the middle 2 are Green and the last are ? yep you guessed it Blue..By overtyping the Zeros with FF or other letters, you can make a variety of colours!

    By using HTML, you can have full control over every letter with font, size and colour.

    Hope this helps you..


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts