Apps Scriptリファレンス: Apps Script Reference |障害・課題追跡: IssueTracker |Google Workspace: Status Dashboard - Summary

2022年11月3日木曜日

Googleドキュメントのテキストの色を一括で変えたい


下記コード.gsの ID を変えて myFunction() を実行すると、ドキュメントのテキストの色を #d3d3d3 に変更できました。



コード.gs
function myFunction() {
  var url = "https://docs.google.com/document/d/ID/edit";
  var doc = DocumentApp.openByUrl(url);
  doc.editAsText().setForegroundColor('#d3d3d3');
}


参考

editAsText()

setForegroundColor(foregroundColor)

Latest post

スプレッドシートの空白セルを直前の値で埋めたい

A列の空白セルに直前の値を入れたくて書いたコードです スプレッドシートに以下のようなBeforeの表があるとき (A列に空白セルがある) Before 1 A B 2 エリア 都市 3 東京 新宿 4 渋谷 5 池袋 6 神奈川 横浜 7 川崎 8 相模原 9 千葉 千葉 10 ...