Will .setRichTextValue accomodate two or more styled striings?

127 views
Skip to first unread message

Sam Duncan

unread,
Mar 31, 2021, 2:15:09 PM3/31/21
to Google Apps Script Community
  · 19h  ·
Hi all, I'm having trouble ferreting out the syntax for using .setRichTextValue to render two styled texts into a single cell. I've read the docs and still can't figure it out.
This does not work:
reportSheet.getRange(1,1).setVerticalAlignment('middle').setRichTextValue(reportIntroACMAAlibStyled, reportIntroMainTextStyled);

I believe I use .setRichTextValue because I'm using a single cell and not .setRichTextValues.

Both these values work fine on their own.
var reportIntroACMAAlibStyled = SpreadsheetApp.newRichTextValue()
.setText('The Amon Carter Museum Research Library')
.setTextStyle(reportIntroStyle)
.build();

var reportIntroMainTextStyled = SpreadsheetApp.newRichTextValue()
.setText('The Amon Carter Museum of American Art Research Library added ' + oclcNumbers.length + ' titles to its collection in ' + reportNamePublishing + '. As a specialized collection focusing on American art and photography, we collect titles often not available in nearby libraries or even those around the world. These titles are available to anyone visiting our library. Each title below provides a link to the CDLC catalog, which provides more information, including call number.')
.setTextStyle(reportIntroStyle)
.build();

Thanks for saving me!
Sam

Tanaike

unread,
Mar 31, 2021, 10:58:07 PM3/31/21
to Google Apps Script Community
Unfortunately, from your question, I cannot understand about your goal. I apologize for this. Can you provide the sample input and output you expect?
Reply all
Reply to author
Forward
0 new messages