Results 1 to 7 of 7
  1. #1
    MrChips is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2012
    Posts
    20

    Changing Font parameters by use of combo boxes in outgoing emails

    This line works Ok in the outgoing Email,
    OutMail.HTMLbody = "<p><font face=""Arial"" size=""2"" color=""black"">Hello</font></br>"


    However, I am trying to use Combo boxes:- cmboFace, cmboSize, cmboColor, to give the user a choice.
    I expected that something like his would work:-
    OutMail.HTMLbody = "<p><font face= cmboFace size= cmboSize color= cmboColor>Hello</font></br>"
    If someone could give me a clue as to the proper way to utilise the combo boxes, I would be most grateful.

    I am using Access 365 in windows11

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    probably needs to be more like

    "<p><font face=" & cmboFace & " size= " & cmboSize & " color= " & cmboColor & ">Hello</font></br>"

    recommend you assign this value to a string, and debug.print it until you get it right

    dim hStr as string

    hStr=
    "<p><font face=" & cmboFace & " size= " & cmboSize & " color= " & cmboColor & ">Hello</font></br>"
    debug.print hStr

  3. #3
    MrChips is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2012
    Posts
    20
    That worked perfectly. I suppose the solution was obvious, but I certainly was unable to find it.
    I can see why doing a debug.print is helpful, thank you.

    Perhaps I may ask one further question?
    I also want to use a textbox to provide the user with variable text in the email.
    Where I have Hello in the above question, I would like to insert text32 instead.

    Even trying the debug.print idea with my attempts, I have been unable to solve it myself.
    Can you help me with this problem as well please?

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Again, just concatenation.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    MrChips is offline Novice
    Windows 11 Office 365
    Join Date
    Aug 2012
    Posts
    20
    I have tried that but every time I tried a versions all I got was whatever was between the < and the following >

    However, I shall persevere, thank yo.

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Try
    Code:
    hStr="<p><font face=" & cmboFace & " size= " & cmboSize & " color= " & cmboColor & ">" & Me.Text32 & "</font></br>"
    debug.print hStr
    
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  7. #7
    MrChips is offline Novice
    Windows 11 Office 365
    Join Date
    Aug 2012
    Posts
    20
    Many thanks Welchgasman.
    During the night, I suddenly understood what you were saying and managed to sort it out myself, based on your advice.
    So, I not only have an answer to my specific problem . . . but now also for any similar future ones.,
    Many thanks for your time and patience. 

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

Similar Threads

  1. Changing font size in message boxes
    By Jerry Call in forum Access
    Replies: 4
    Last Post: 06-03-2020, 11:49 AM
  2. Replies: 7
    Last Post: 12-30-2015, 01:04 PM
  3. Changing text boxes to combo boxes
    By Lou_Reed in forum Access
    Replies: 8
    Last Post: 09-15-2015, 11:09 AM
  4. Replies: 4
    Last Post: 10-24-2013, 12:32 PM
  5. Changing Font to Bold
    By tikrit in forum Reports
    Replies: 3
    Last Post: 01-01-2013, 05:45 PM

Tags for this Thread

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