bold line in auto email code

dark11984

Registered User.
Local time
Today, 19:41
Joined
Mar 3, 2008
Messages
129
Hi,
I'm trying to make a line of text in an email bold. I've searched heaps of other threads and found lots of info on it but still no luck.

I've tried .fontbold = true and .bold = true.

I want to make the line that contains SigFname and SigSName bold and all other texts normal.
Code:
MyMail.Body = "Attached is the SSO Monhtly report for " & [PrevMth] & "." & vbNewLine & vbNewLine & _
            "Regards," & vbNewLine & vbNewLine & _
            [SigFname] & " " & [SigSName] & vbNewLine & _
            [sigPosition] & vbNewLine & _
            [SigDepartment] & " | " & [SigCompany] & vbNewLine & _
            "P:" & " " & [SigPhone] & " | M: " & [SigMobile] & " | F: " & [SigFax] & vbNewLine & _
            "E:" & " " & [SigEmail]

Cheers,
 
It is going to depend on your e-mail editor, which in turn depends on your version of Office. Starting with Access 2007, I believe, you can have Word as your editor for e-mail. Then it would be possible to select that line and embolden it.

Since I've never actually tried that, I'm not up on it, but it is theoretically possible.

If you are on something before Office 2007, I'm not so sure because I don't think Word was the editor of choice in that case.
 
Something to try: -

Code:
Sub TestIt()

    With CreateObject("Outlook.Application").CreateItem(0)
        .Subject = "My Subject"
        
        ' Set body format to HTML
        .BodyFormat = 2
        
        ' Format the message
        .HTMLBody = _
            "<html>" & _
                "Dear Sir" & "<br><br>" & _
                "<b>" & _
                    "Name: " & "Sam Spade" & "<br>" & _
                    "Position:" & "Chief Cook and Bottle Washer" & "<br><br>" & _
                "</b>" & _
                "Normal body text starts here." & "<br><br>" & _
            "</html>"

        ' Display Email
        .Display
    End With

End Sub

Chris.
 
Well just wrote my first html code... Thanks Chris.

Only problem is it changed to Times New Roman font, any idea to how to get the font to Arial?
 
Code:
Sub TestIt()

    With CreateObject("Outlook.Application").CreateItem(0)
        .Subject = "My Subject"
        
        ' Set body format to HTML
        .BodyFormat = 2
        
        ' Format the message
        .HTMLBody = _
            "<html>" & _
                "Dear Sir" & "<br><br>" & _
                "<b>" & _
                    "Name: " & "Sam Spade" & "<br>" & _
                    "Position:" & "Chief Cook and Bottle Washer" & "<br><br>" & _
                    "<font face='Arial'" & "<br>" & _
                        "Name: " & "Sam Spade" & "<br>" & _
                        "Position:" & "Chief Cook and Bottle Washer" & "<br><br>" & _
                    "</font>" & _
                    "<font face='Monotype Corsiva'" & "<br>" & _
                        "Name: " & "Sam Spade" & "<br>" & _
                        "Position:" & "Chief Cook and Bottle Washer" & "<br><br>" & _
                    "</font>" & _
                "</b>" & _
                "Normal body text starts here." & "<br><br>" & _
            "</html>"

        ' Display Email
        .Display
    End With

End Sub
 

Users who are viewing this thread

Back
Top Bottom