Pages

Monday, 7 October 2019

Google Doc - add hyperlink text

The following Google Apps Script is designed to add some hyperlink text to an existing Google Doc - the BBC news website in this example.
Screenshot of Google Doc text with hyperlink
Screenshot of Google Doc text with hyperlink

It makes use of 'setLinkUrl' when appending a paragraph of text.
docBody.appendParagraph('BBC news link').setLinkUrl('https://www.bbc.co.uk/news');

Google Doc - add hyperlink text.gs

No comments:

Post a comment