How can I add/insert html text (contains italic/bold tag & some other tags for text formatting) in Google docs using Google Apps Script?
You can use the in-built Utilities method to get the formatted text
function makeNewDoc()
{
var html = '<html><body><h1><i><b>HEADING</b></i></h1></body></html>';
var blob1 = Utilities.newBlob("").setDataFromString(html, "UTF-8").setContentType("text/html");
var newFileId = Drive.Files.insert({title: "TEST"}, blob1, {convert: true});
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With