Forum Discussion
How to export text entries to a Word document
This is great! Your downloaded sample files worked perfectly. I'm having trouble stylizing the imported variables. As an example, I would want the variable text that's imported to be larger in font size and red in colour. This is how I'm trying to write this code (Sorry, I'm pretty new to Javascript), but it doesn't seem to work. Any advice?
<p style='font-size:24px; color:#B80003;'> player.GetVar("TextEntry") </p>
- CraigAgnew-6cde3 years agoCommunity Member
Hi Julio
Any HTML tags need to be put in quotes and then the Storyline variable gets added using plus (+) symbols, so the example you have would look like this:
"<p style='font-size:24px; color:#B80003;'>" + player.GetVar("TextEntry") + "</p>"
If you are including any tags before the p tag here, then make sure it is all included within one set of quotes, e.g. the whole code would look like this:
var html = HtmlHead +
"<h1>Activity 1</h1><p style='font-size:24px; color:#B80003;'>
"
+ player.GetVar("TextEntry") + "</p>"
+ EndHtml;I hope this helps.
It can get pretty confusing when you're trying to string together several variables with all of the plus signs and quotes!
Cheers, Craig