Mauricio Calvao
Mauricio Calvao

Reputation: 475

how to bold text inside a Browser.msgBox under Google Apps script

I have the following Google script linked to a sheet:

function onOpen() {
  var text_aux = 'texto'.bold();
  Browser.msgBox("AVISOS:\\n" + "\\n1. Prazo" + " impreterível " +     text_aux + " para preenchimento: 02/07/2017 (domingo).")
}

My intention is that it should show the string 'texto' in bold, when the alert box pops up. However it just shows the string within the html bold tags instead:

<b>texto</b>

not texto, as I want. How do I achieve it?

Upvotes: 1

Views: 3689

Answers (1)

Cooper
Cooper

Reputation: 64082

How about this:

function texto()
{
  var s="AVISOS:<br />" + "<br />1. Prazo" + " impreterível " + '<strong>texto</strong>' + " para preenchimento: 02/07/2017 (domingo)."
  s+='<br /><input type="button" value="Exit" onClick="google.script.host.close();" />'
  var html=HtmlService.createHtmlOutput(s)
  SpreadsheetApp.getUi().showModelessDialog(html, 'Message Title');
}

Upvotes: 2

Related Questions