+ Reply to Thread
Results 1 to 9 of 9

Userform HTML email format help needed please

  1. #1
    Registered User
    Join Date
    09-07-2013
    Location
    Chester
    MS-Off Ver
    Home: 2011 for Mac Work: 2007
    Posts
    70

    Userform HTML email format help needed please

    Hello all

    I have a userform which sends the form entries via email, I have it working fine when sending as Plain text however I want to send in HTML and I'm struggling with the code to enter line breaks etc

    This is an extract of the code for the email body which I need to format to work with HTML. Currently it populates the form entries to email however I can't add line breaks as needed

    Please Login or Register  to view this content.
    Does anyone know how I would write the code so I have OrderIT Reference : iOrderIt, then a line break, with Customer : iCustomer on the next line?

    I'm very much a VBA novice so any help would be greatly appreciated

    Many thanks in advance

    Twaddy

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Userform HTML email format help needed please

    Hi, Twaddy006,

    try
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    09-07-2013
    Location
    Chester
    MS-Off Ver
    Home: 2011 for Mac Work: 2007
    Posts
    70

    Re: Userform HTML email format help needed please

    Hi HaHoBe

    Thanks very much for your quick reply, worked a treat...so simple, I'd tried <br> but didn't realise I needed the quotation marks too

    Do you know how I would also set the font to Ariel and size 10 as it's currently defaulting to Times Roman size 12?

    Many thanks

    Twaddy

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Userform HTML email format help needed please

    Hi, Twaddy006,

    regarding the font type which I use when filling the Body of teh email:
    Please Login or Register  to view this content.
    AFAIR there are only 7 types of font sizes available in HTML ranging from 1 being the msmallest to 7 as the largest. If you open up the expanded answering window in this Forum and check Size from the dropdown this will give you an image of how big/small the individual size will be.

    Font Size may be given as
    Please Login or Register  to view this content.
    You may combine these commands in one but you need to be aware of the font size being used as regular has an influence on the size you will use (any 14 pt. will look a lot bigger than a 9 pt. with size 4).

    Ciao,
    Holger

  5. #5
    Registered User
    Join Date
    09-07-2013
    Location
    Chester
    MS-Off Ver
    Home: 2011 for Mac Work: 2007
    Posts
    70

    Re: Userform HTML email format help needed please

    Hi

    Thanks very much, had a play about and got it looking like I need

    One last question seen as you seem to have all the answers right now...

    I've used Application.SendKeys "%s" on a previous macro to auto accept the Outlook security warning and send the email, do you know if this can be adapted to bypass the warning message but then display the email rather than send? Users on occasion will need to add attachments or change the recipients so I want the email to be visible before the user manually sends.

    Currently my code is written as...

    Please Login or Register  to view this content.
    This is to allow the Outlook auto signature to populate on the email of whoever is using the form before adding the text from the user form, the problem being I receive a warning message initially before the email loads with the signature, and then another warning message before the user form text populates in the body of the email

    Any thoughts?

    Thanks again

    Twaddy

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Userform HTML email format help needed please

    Hi, Twaddy006,

    at the place I work we use Windows7 and Office2010 with the excel workbook being located on a server while the profile for Outlook is on the local PC. For using the signature I relied on Insert Outlook Signature in mail although I was forced to work with a modified version of the commonly used one by Outlook itself. I developed and tested most of the mail part on a laptop with Windows7 and Office2007 with just one HDD where the data was stored but it worked fine for me in both situations.

    Ciao,
    Holger

  7. #7
    Registered User
    Join Date
    09-07-2013
    Location
    Chester
    MS-Off Ver
    Home: 2011 for Mac Work: 2007
    Posts
    70

    Re: Userform HTML email format help needed please

    Thanks very much, I'll have a read and see if it will work for me. My VBA knowledge is basic at best so most of what I'm doing is trial error, often lots or error

    Do you know whether the first option on the linked page will add the signature of whoever uses the form? I can't see reference to naming the signature on the first example as it does on the 2nd so I'm guessing it would

    Thanks

  8. #8
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Userform HTML email format help needed please

    Hi, twaddy,

    if there is a signature the code should get the default one. So you should check if the user has set up a signature before you try to get hold of it or rebuild the signature by HTML-code if none is available.

    Ciao,
    Holger

  9. #9
    Registered User
    Join Date
    09-07-2013
    Location
    Chester
    MS-Off Ver
    Home: 2011 for Mac Work: 2007
    Posts
    70

    Re: Userform HTML email format help needed please

    Thanks for all your help today HaHoBe, really is appreciated

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. format userform output to email
    By EagleInsight in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-22-2014, 09:28 PM
  2. Macro to send saved draft email from outlook in HTML format
    By jamesshakedown in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-18-2013, 07:55 AM
  3. Email HTML Hotspot from Lotus Notes - Initialize Help Needed
    By sparrowce in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-23-2013, 09:50 AM
  4. How to parse data in Outlook email using HTML version of email back to excel
    By bnasty in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 10-31-2012, 02:54 PM
  5. [SOLVED] Macro to body of email from word & excel - can't get HTML format correct
    By MacroMess in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-01-2012, 01:32 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1