Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

change font-family in message template body using javascript

Posted on by 826

Hi Everyone,

 

I wrote a Javascript to fetch the template and populate on the message body.  Now i would like to change the font-family and font-size of the content in the message body. 

8407.Screenshot_5F00_1.jpg

i tried  this following code inside the javascript and its not working. 

document.body.style.fontSize="10px";
document.body.style.fontFamily="somefont"

or

* {
font-family: somefont ;
font-size: 10px;
}                                      

any other suggestions are welcome.

*This post is locked for comments

  • Suggested answer
    Rawish Kumar Profile Picture
    Rawish Kumar 13,756 on at
    RE: change font-family in message template body using javascript

    Hi Ram,

    Can you actually fix the fonts in template itself?

    Correct the format in template in a word document and paste in the template body.

  • sardar ahmed Profile Picture
    sardar ahmed 520 on at
    RE: change font-family in message template body using javascript

    Hi Ram,

    You can use style attribute for changing the font.

    <p style="font-size:12px">Your text<p>

    Thanks and Regards

    Sardar Ahmed

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans