+ Reply to Thread
Results 1 to 10 of 10

VBA code Font.Bold

  1. #1
    Registered User
    Join Date
    09-12-2013
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    44

    Question VBA code Font.Bold

    Good morning all,

    I have a VBA code dat generate an outlook email, what i need to do is to show only the labels Font.Bold
    Example:
    Msg = Msg & Me.Label1.Caption & " : " & Me.ComboBox1.Value & vbCrLf
    (Label1 name is "Assigned to")

    Thank you guys for the help.
    Cheers
    Gabriel

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: VBA code Font.Bold

    You would need to use a userform rather than a msgbox if you want to format the display in that way.

    Your userform would need to labels in order to have the appearance of mixed formatting.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    09-12-2013
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    44

    Re: VBA code Font.Bold

    Hi Andy,

    Yes i do have the UserForm and i made a sheet with parameters Param" if you can see in the code below, what i need to do is show only the labels Bold:
    Please Login or Register  to view this content.
    Last edited by GAMU; 10-01-2013 at 04:19 AM. Reason: Regarding Rule 3 Posting Code

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: VBA code Font.Bold

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)


    So you want the message in the actual email body to have the bold formatting? If so you will need to create the html required to have that appear.

    This should give you a starting point on generating the html
    http://www.rondebruin.nl/win/s1/outlook/bmail2.htm

  5. #5
    Registered User
    Join Date
    09-12-2013
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    44

    Re: VBA code Font.Bold

    Thank you for the info Andy, i read lots of the forum rules and i didn't remember this one. I edit all my posts vba-code between
    Please Login or Register  to view this content.
    this should prevent breaking-rules of the forum which is surely not my intention.

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: VBA code Font.Bold

    no problem, thanks for updating your post.

  7. #7
    Registered User
    Join Date
    09-12-2013
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    44

    Re: VBA code Font.Bold

    I followed the link: http://www.rondebruin.nl/win/s1/outlook/bmail2.htm
    I am kind of lost with html combined with vba

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: VBA code Font.Bold

    something like this, I've done the first item adding the < B > and < BR > tags

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    09-12-2013
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    44

    Re: VBA code Font.Bold

    hi Andy
    It's working
    (i am making some research to see if is possible to change the standard html fontstyle Times in Calibri+fontSize)
    Thank you for teaching and helping us.

    Cheers
    Gabriel

  10. #10
    Registered User
    Join Date
    09-12-2013
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    44

    Lightbulb Re: VBA code Font.Bold

    In case you need to change fontstyle and Size:
    [CODE]
    Msg = Msg & "<B><font face=Calibri><font size=2>" & Me.Label1.Caption & "</B> : " & Me.ComboBox1.Value & "<BR></font>"
    [/CODE
    Last edited by GAMU; 10-01-2013 at 08:44 AM. Reason: Rule3

+ 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. Need BOLD Font in VBA
    By rsanti in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-03-2012, 08:22 PM
  2. VBA - Add Font Bold
    By Redd in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-15-2007, 03:57 PM
  3. Replies: 1
    Last Post: 11-07-2007, 08:45 PM
  4. Maintain a BOLD font
    By Martindelica in forum Excel General
    Replies: 1
    Last Post: 08-25-2007, 12:33 PM
  5. Bold Font
    By scantor145 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-17-2006, 09:15 AM

Tags for this Thread

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