+ Reply to Thread
Results 1 to 7 of 7

Trouble with HTML tags for font style and size

  1. #1
    Forum Contributor
    Join Date
    10-08-2013
    Location
    London
    MS-Off Ver
    365
    Posts
    136

    Trouble with HTML tags for font style and size

    Hi All,

    I'm having trouble with HTML tags in an email body for font type and size. I am using Ron de Bruin's code to send an Outlook email with a PDF of a selection of code but I just cannot get the body of the email to behave. The following code:
    Please Login or Register  to view this content.
    Produces this in the body of the email:

    DearCAT,

    Please be advised that this refund request has been processed.

    Client Name : me
    Client Number: 123
    Shipment Number: 123456
    Refund Amount: £456
    Payment Method: 6 - MAESTRO/PIN/EPS
    Date payment taken: 12/05/2015

    Regards,

    The bold works fine but what I am also looking for is the font to all be 11pt and all in Calibri. I've tried about 30 different ways of adding HTML tags for font style and size but seem to be getting nowhere. For example, one of my more lengthy attempts:
    Please Login or Register  to view this content.
    Can some one please give me a hint how to tag this text?

    Many thanks,
    Dave C

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Trouble with HTML tags for font style and size

    Can you post the rest of the code?
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    10-08-2013
    Location
    London
    MS-Off Ver
    365
    Posts
    136

    Re: Trouble with HTML tags for font style and size

    A cut down version of the code:
    Please Login or Register  to view this content.
    Thanks,

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Trouble with HTML tags for font style and size

    If you want the font in 11pt then use 11pt instead of 11.
    Please Login or Register  to view this content.
    By the way, why are you creating 2 instances of Outlook and creating a mail message in each?

  5. #5
    Forum Contributor
    Join Date
    10-08-2013
    Location
    London
    MS-Off Ver
    365
    Posts
    136

    Re: Trouble with HTML tags for font style and size

    Thanks Norie, that seems to work!

    As for two emails, I have probably left code in there from a previous incarnation of the macro. If you're looking at the following I think I can just delete this:
    Please Login or Register  to view this content.
    I think the mail message is only called once using :
    Please Login or Register  to view this content.
    I'm not very good at this yet!

    Also, how can I use HTML tags to get rid of the double spacing between the lines in the email body?

    Many thanks,

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Trouble with HTML tags for font style and size

    You could remove these line break tags from the HTML.
    HTML Code: 

  7. #7
    Forum Contributor
    Join Date
    10-08-2013
    Location
    London
    MS-Off Ver
    365
    Posts
    136

    Re: Trouble with HTML tags for font style and size

    Of course removing the <br> is the obvious fix but I think I was in a hurry to get out of the office yesterday and did not explain very well. I think the <p> tags on every line are creating my double spacing issue. When I remove them, there is regular spacing like this:

    Client Name : me
    Client Number: 123
    Shipment Number: 123456
    Refund Amount: £456
    Payment Method: 6 - MAESTRO/PIN/EPS
    Date payment taken: 12/05/2015

    But when the style tags are added I get this:

    Client Name : me

    Client Number: 123

    Shipment Number: 123456

    Refund Amount: £456

    Payment Method: 6 - MAESTRO/PIN/EPS

    Date payment taken: 12/05/2015

    Is there a way to apply the style to the whole message rather than line by line? I feel this may be the answer.

    Thanks,

+ 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. [SOLVED] specific colour of text and font in email body- need HTML tags
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-18-2015, 05:10 AM
  2. [SOLVED] Format Spreadsheet - borders, font size/style, split text to columns
    By lacke81c in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-30-2015, 02:34 PM
  3. Replies: 1
    Last Post: 11-08-2013, 04:16 AM
  4. Header Trouble with bolding and font size
    By Mdf51 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-18-2013, 03:32 AM
  5. How to using comma style without change font & font size
    By rameshtupe in forum Excel General
    Replies: 1
    Last Post: 07-11-2013, 01:19 PM
  6. convert formated excel column to html source text with html tags
    By julia81 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-19-2011, 04:22 PM
  7. Header Date Modified - Adjusting Font Style and Size Problems
    By herkie94 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-23-2009, 06:24 AM

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