Results 1 to 28 of 28

Thread: Looking for control that will allow me to create a html body for an email

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2011
    Posts
    612

    Looking for control that will allow me to create a html body for an email

    Hi, looking for a way to create text only that i can add to an email.

    I would like it to be able to indent add bullet point colour fonts and colour background of fonts ( ie highlight)

    does anyone know of a free control or usercontrol that would allow a type of word processor and then create html text
    that i can save as a template when sending an email.

    tks

  2. #2
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,435

    Re: Looking for control that will allow me to create a html body for an email

    I have a very old module for converting RTF to HTML.
    I've used it in the past to convert the output of the RichTextBox control to an HTML file

    The URL in header is not functional anymore and I also can't find it on the wayback archive..

    Code:
    'Version 3.03
    'Copyright Brady Hegberg 2000
    '  I'm not licensing this software but I'd appreciate it if
    '  you'd to consider it to be under an lgpl sort of license
    
    'More information can be found at
    'http://www2.bitstream.net/~bradyh/downloads/rtf2htmlrm.html
    
    'Converts Rich Text encoded text to HTML format
    'if you find some text that this function doesn't
    'convert properly please email the coded text to
    'bradyh@bitstream.net
    
    'Thanks to various people for assistance including
    '   Anthony DiMauro for work on 3.0x font support
    '   ...and many others
    I will attach a zipped version of the code.
    Attached Files Attached Files

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2011
    Posts
    612

    Re: Looking for control that will allow me to create a html body for an email

    Quote Originally Posted by Arnoutdv View Post
    I have a very old module for converting RTF to HTML.
    I've used it in the past to convert the output of the RichTextBox control to an HTML file

    The URL in header is not functional anymore and I also can't find it on the wayback archive..

    Code:
    'Version 3.03
    'Copyright Brady Hegberg 2000
    '  I'm not licensing this software but I'd appreciate it if
    '  you'd to consider it to be under an lgpl sort of license
    
    'More information can be found at
    'http://www2.bitstream.net/~bradyh/downloads/rtf2htmlrm.html
    
    'Converts Rich Text encoded text to HTML format
    'if you find some text that this function doesn't
    'convert properly please email the coded text to
    'bradyh@bitstream.net
    
    'Thanks to various people for assistance including
    '   Anthony DiMauro for work on 3.0x font support
    '   ...and many others
    I will attach a zipped version of the code.

    Tks i got this today and already had a play. does most of what i need but does not highlight text background.

    I will try to study whats there and see if i can add the feature to highlight text. but never really dealt with RTB codes etc

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2011
    Posts
    612

    Re: Looking for control that will allow me to create a html body for an email

    out of interest, would it be possible to use a browser/RC6 to load a webpage that has a pre built web based HTML editor like what we use on this site
    that i could embed in a form and create text etc. then use the browser text out put.??

  5. #5
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,435

    Re: Looking for control that will allow me to create a html body for an email

    There is also the quite ancient HTMLEdit control.
    I have used in a project back in 1999/2000

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2011
    Posts
    612

    Re: Looking for control that will allow me to create a html body for an email

    Quote Originally Posted by Arnoutdv View Post
    There is also the quite ancient HTMLEdit control.
    I have used in a project back in 1999/2000
    do you have a link or zip to it. tks

  7. #7
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    10,738

    Re: Looking for control that will allow me to create a html body for an email

    I've got no idea what you're trying to do, or what the requirements are of whatever email client you're using ...

    but, why not just use something like https://htmleditor.online/ and be done with it?
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2011
    Posts
    612

    Re: Looking for control that will allow me to create a html body for an email

    Quote Originally Posted by Elroy View Post
    I've got no idea what you're trying to do, or what the requirements are of whatever email client you're using ...

    but, why not just use something like https://htmleditor.online/ and be done with it?
    Hi Elroy. I have an app that i save information to. once processed i want to be able to email with Outlook.
    I have this all working , but was asked to include some text in the body of the email.
    I did not want to hard code into my app, so made a settings page to store email subject and email body.

    I would like to give the user the ability to create an email with basic items ie Bold, Highlight text , font colour, Bullet points, indenting.

    I thought there would be a simple editor that i could incorporate into my app that would enable a user to add/create their own email body without knowing html.

    tks

  9. #9
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,435

    Re: Looking for control that will allow me to create a html body for an email

    Quote Originally Posted by k_zeon View Post
    do you have a link or zip to it. tks
    No, it was called dhtmledit.ocx or something like that

  10. #10
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    10,738

    Re: Looking for control that will allow me to create a html body for an email

    If it were me, I'd probably use the RichTx32.ocx (Microsoft Rich Textbox) control, and design a little editor for it, as I've actually done that before, and it's not difficult:

    Name:  RtfEdit.png
Views: 355
Size:  8.0 KB

    Then, upon the click of some button, I'd grab the RTF text from it and convert it to HTML, which, so long as the RTF text was fairly simple, wouldn't be difficult at all.

    Anyway, that's how I'd do it.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  11. #11
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    10,738

    Re: Looking for control that will allow me to create a html body for an email

    Here, I've attached a little project that includes this little RTF label editor. This particular editor is designed to be used in the VB6 IDE design-time mode, and not by the user. To call up the editor, right-click the label on Form1 and click "Edit".

    Much of the "editor" functionality you're asking for is there. Maybe you can modify it for your needs.



    Also, I noticed that editor is acting a bit glitchy. I haven't used it in a while, and that's something new. I don't know if that's updates to RichTx32.ocx, or something about Windows 11, or whatever. But, you're on your own there.



    I fixed it. In the frmRtfEdit form (RtfEdit.frm), in the QueryUnload event, a "Cancel = True" line is needed, as follows:

    Code:
    
    Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
        If UnloadMode = vbFormControlMenu Then
            bCanceled = True
            Hide
            Cancel = True
        End If
    End Sub
    That fixes it.



    Good Luck.
    Attached Files Attached Files
    Last edited by Elroy; Feb 15th, 2025 at 01:12 PM.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  12. #12
    Addicted Member
    Join Date
    May 2012
    Location
    42.787034,-81.176367
    Posts
    152

    Re: Looking for control that will allow me to create a html body for an email

    Quote Originally Posted by k_zeon View Post
    do you have a link or zip to it. tks
    On my Windows 10 system;
    Code:
    Directory of  C:\Program Files (x86)\Common Files\Microsoft Shared\DhtmlEd\*
    
    2025-01-30   7:44         <DIR>    .
    2025-01-30   7:44         <DIR>    ..
    2025-01-30   7:44          32,256  dhtmled.oca
    2006-07-05  16:12         244,640  DHTMLEd.ocx
    2006-07-05  16:12         273,368  TriEdit.dll
    This is included with Visual Basic 6.0

    Is it on your system already?

    Joe

  13. #13
    Addicted Member
    Join Date
    May 2012
    Location
    42.787034,-81.176367
    Posts
    152

    Re: Looking for control that will allow me to create a html body for an email

    DHTML Editing Control for Applications Redistributable Package (x86) for Windows

    Ref: https://download.cnet.com/dhtml-edit...-10743863.html

    Joe

  14. #14
    Hyperactive Member gaouser's Avatar
    Join Date
    Mar 2022
    Location
    World:\Turkey\User32.DLL
    Posts
    510

    Re: Looking for control that will allow me to create a html body for an email

    Quote Originally Posted by k_zeon View Post
    Hi, looking for a way to create text only that i can add to an email.

    I would like it to be able to indent add bullet point colour fonts and colour background of fonts ( ie highlight)

    does anyone know of a free control or usercontrol that would allow a type of word processor and then create html text
    that i can save as a template when sending an email.

    tks
    WebBrowser with the ContentEditable or the MS DHTML Editor control thing that isn't recommended and actually is even older than WebBrowser's IE.

    Code:
    htmlEditor.Document.execCommand "Bold", False, Nothing
    htmlEditor.SetFocus
    Example execCommand to text highlighted text bold.
    MicrosoftWindowsxp
    Professional

    was the peak Windows version not gonna lie

  15. #15
    Hyperactive Member gaouser's Avatar
    Join Date
    Mar 2022
    Location
    World:\Turkey\User32.DLL
    Posts
    510

    Re: Looking for control that will allow me to create a html body for an email

    Do not use RTF. It'll be a pain. and IE's HTML is easily enough for email body. who wants CSS emails? corporate junk.
    MicrosoftWindowsxp
    Professional

    was the peak Windows version not gonna lie

  16. #16
    Hyperactive Member gaouser's Avatar
    Join Date
    Mar 2022
    Location
    World:\Turkey\User32.DLL
    Posts
    510

    Re: Looking for control that will allow me to create a html body for an email

    DHTML Edit uses older IE, and from what I found, execCommand is missing and idk any way to get the highlighted text area
    MicrosoftWindowsxp
    Professional

    was the peak Windows version not gonna lie

  17. #17
    Hyperactive Member gaouser's Avatar
    Join Date
    Mar 2022
    Location
    World:\Turkey\User32.DLL
    Posts
    510

    Re: Looking for control that will allow me to create a html body for an email

    so, try ContentEditable WebBrowser. Can't believe none of you thought about it. It even has ways to bold out or italic out or even change font of a highlighted area. Perfect for writing.
    MicrosoftWindowsxp
    Professional

    was the peak Windows version not gonna lie

  18. #18
    Hyperactive Member gaouser's Avatar
    Join Date
    Mar 2022
    Location
    World:\Turkey\User32.DLL
    Posts
    510

    Re: Looking for control that will allow me to create a html body for an email

    Quote Originally Posted by Joe Caverly View Post
    On my Windows 10 system;
    Code:
    Directory of  C:\Program Files (x86)\Common Files\Microsoft Shared\DhtmlEd\*
    
    2025-01-30   7:44         <DIR>    .
    2025-01-30   7:44         <DIR>    ..
    2025-01-30   7:44          32,256  dhtmled.oca
    2006-07-05  16:12         244,640  DHTMLEd.ocx
    2006-07-05  16:12         273,368  TriEdit.dll
    This is included with Visual Basic 6.0

    Is it on your system already?

    Joe
    You need to register it with regsvr32 though. It's preinstalled but not registered.
    MicrosoftWindowsxp
    Professional

    was the peak Windows version not gonna lie

  19. #19
    Hyperactive Member gaouser's Avatar
    Join Date
    Mar 2022
    Location
    World:\Turkey\User32.DLL
    Posts
    510

    Re: Looking for control that will allow me to create a html body for an email

    Quote Originally Posted by gaouser View Post
    so, try ContentEditable WebBrowser. Can't believe none of you thought about it. It even has ways to bold out or italic out or even change font of a highlighted area. Perfect for writing.
    Code:
    WebBrowser1.Document.body.designMode = "on"
    (don't forget to load a blank page like about:blank before executing)
    MicrosoftWindowsxp
    Professional

    was the peak Windows version not gonna lie

  20. #20

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2011
    Posts
    612

    Re: Looking for control that will allow me to create a html body for an email

    tks to all that replied. I will try to create a simple editor with webbrowser. Out of interest, does anyone know the execCommand to highlight text backcolour

    also, if Olaf is listening , can the RC6 dll be used with Webview2 to do the same as the webbrowser control.

    can you give me a basic starting point of how to do this. tks

  21. #21
    Junior Member anycoder's Avatar
    Join Date
    Jan 2025
    Posts
    21

    Re: Looking for control that will allow me to create a html body for an email

    List of commands for the designmode mode are available at this link
    https://learn.microsoft.com/en-us/pr...ectedfrom=MSDN

    For yellow color try this:
    document.ExecCommand "BackColor", 0, &H00FFFF&
    Last edited by anycoder; Feb 18th, 2025 at 03:57 AM.

  22. #22
    Hyperactive Member gaouser's Avatar
    Join Date
    Mar 2022
    Location
    World:\Turkey\User32.DLL
    Posts
    510

    Re: Looking for control that will allow me to create a html body for an email

    Quote Originally Posted by k_zeon View Post
    tks to all that replied. I will try to create a simple editor with webbrowser. Out of interest, does anyone know the execCommand to highlight text backcolour

    also, if Olaf is listening , can the RC6 dll be used with Webview2 to do the same as the webbrowser control.

    can you give me a basic starting point of how to do this. tks
    I am not sure if Trident engine is that capable. CSS is worst nightmare of Trident.

    as for WV2. You can set attribute contentEditable of body tag. but remember to remove it when uploading it!
    MicrosoftWindowsxp
    Professional

    was the peak Windows version not gonna lie

  23. #23
    Hyperactive Member gaouser's Avatar
    Join Date
    Mar 2022
    Location
    World:\Turkey\User32.DLL
    Posts
    510

    Re: Looking for control that will allow me to create a html body for an email

    Quote Originally Posted by anycoder View Post
    List of commands for the designmode mode are available at this link
    https://learn.microsoft.com/en-us/pr...ectedfrom=MSDN

    For yellow color try this:
    document.ExecCommand "BackColor", 0, &H00FFFF&
    that'll likely change bgcolor of body tag. I don't know any HTML4.01 tags to do that
    MicrosoftWindowsxp
    Professional

    was the peak Windows version not gonna lie

  24. #24
    Member
    Join Date
    Nov 2020
    Posts
    53

    Re: Looking for control that will allow me to create a html body for an email

    We use TinyMCE where I work for this. We have a form that acts as a webview2 window from RC6 and load the js version of their editor. Its a pretty full featured WYSIWYG and has a free version. It makes it pretty easy for people who dont know html / css to make emails.

    https://www.tiny.cloud/blog/tinymce-...g-html-editor/

  25. #25
    Hyperactive Member gaouser's Avatar
    Join Date
    Mar 2022
    Location
    World:\Turkey\User32.DLL
    Posts
    510

    Re: Looking for control that will allow me to create a html body for an email

    WebBrowser1 is the best option imo.
    MicrosoftWindowsxp
    Professional

    was the peak Windows version not gonna lie

  26. #26

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2011
    Posts
    612

    Re: Looking for control that will allow me to create a html body for an email

    so i have started the html editor and have the following working.
    Bold, Italic , Underline , Cut ,Copy , Paste , Forecolour, Backcolour



    But i am having a little trouble with Unorderd List , Indenting , Left/Center/Right Justify

    i use
    Code:
    WebBrowser1.Document.Execcommand "JustifyLeft"
    WebBrowser1.Document.Execcommand "JustifyCenter"
    WebBrowser1.Document.Execcommand "JustifyRight"
    but this seems to justify the whole document. How can i only justify selected text. same goes for UnorderedList and Indenting.

    if i use
    Code:
    WebBrowser1.document.execCommand('InsertUnorderedList',false,'NewUL')
    it puts a bullet point on the first line , but when i hit enter it starts a new paragraph and not bulleted.
    If i however hold the Shift Key and press enter, it does goto next line and keeps the bullet alignment but does not create a new bullet point.

    any help appreciated. tks
    Last edited by k_zeon; Feb 18th, 2025 at 05:40 PM.

  27. #27
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,788

    Re: Looking for control that will allow me to create a html body for an email

    Btw, back in the day TinyMCE supported IE11 and we are still using version 4.1.3 (2014-07-29) hosted in a WebBrowser control to edit media content as HTML but it's far too complicated solution to post a snippet here so I'll post only a sample screenshot:



    Note that this content editor is 100% JS based as used by WordPress.

    cheers,
    </wqw>

  28. #28

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2011
    Posts
    612

    Re: Looking for control that will allow me to create a html body for an email

    tks. is this something that i could include in one of my projects.( how easy would it be) , can you adjust what buttons are displayed as would not need all of them.

Posting Permissions

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



Click Here to Expand Forum to Full Width