Results 1 to 3 of 3
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097

    Capturing htm formatted source to email via CDO

    I've been using Colin's contribution to the Forum (See #5 in Programming: "Sending emails with VBA CDO") that tests the use of CDO to send emails. Both of Colin's simple text and HTML tests work exactly "as advertised". I've adopted the simple text code behind a form where a user can specify the To, From, Subject and Body and "send" without any difficulty. The body text can be entered into the spacious text box on the form from which the "Body Field" in CDO can be set in addition to the related fields and the email sent.



    So, given the esoteric nature and syntax of htm together with the limited nature of an Access text box control, it would seem that one would have to create htm coded text outside of Access then paste the "htm source" into a form's text box. Or, am I missing something that is built into Access I've not yet discovered?

    Thanks,
    Bill

  2. #2
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Hi again
    Personally I don't use HTML email often with CDO and have never bothered to setup a form to handle that specifically.

    As already mentioned in a private email to you, inline images are usually blocked by email apps such as Outlook, Windows Mail & GMail.
    For that reason, HTML email is a less attractive option these days than used to be the case

    However, I do have other forms that create complex HTML content including formatted text, inline images, hyperlinks and video links e.g. You Tube.
    For example for a help system with one of my large commercial apps which has both a rich text screen (formatted text only) as well as an HTML version (with all the above)
    To create the HTML version I use a web browser control

    For example, this is the form used for editing content - both rich text (on the left) and HTML (on the right)
    Apologies for the large screenshots - these are full screen forms

    Click image for larger version. 

Name:	Capture.PNG 
Views:	12 
Size:	142.4 KB 
ID:	45236

    This shows the HTML source code:

    Click image for larger version. 

Name:	Capture1.PNG 
Views:	12 
Size:	125.0 KB 
ID:	45237

    The HTML output is probably more complex than most HTML emails. Here is a printout of a relatively simple topic created using this form:
    Click image for larger version. 

Name:	Capture3.jpg 
Views:	12 
Size:	95.6 KB 
ID:	45238

    The same method can be used to create topics covering multiple pages with numerous images & hyperlinks.
    However be warned - setting up this form was a lot of work

    Hope that helps


    .
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097
    I'll play with what I've done so far plus experiment with the browser control so I can best determine how to capitalize on my newfound discovery of CDO. Clearly, CDO will help provide more user friendly UI when bulk emailing come into play.

    I'll mark the OP as solved, as anyone following the thread should get see the breadth of using CDO, especially if they download and examine your tester code like I did.

    Thanks again,
    Bill

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Capturing Button Name
    By Eranka in forum Access
    Replies: 3
    Last Post: 05-30-2018, 03:44 PM
  2. Replies: 2
    Last Post: 08-13-2015, 11:20 AM
  3. How to send formatted email without outlook
    By alex1888 in forum Programming
    Replies: 2
    Last Post: 06-04-2015, 08:32 PM
  4. Capturing F1 key so I can display Help screen
    By JrMontgom in forum Programming
    Replies: 7
    Last Post: 04-12-2015, 07:38 AM
  5. Capturing the recordset of a subform
    By tylerg11 in forum Access
    Replies: 1
    Last Post: 02-06-2013, 01:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums