javascript - Copying text from one google Doc, to another active google Doc -


i have body of text in master document(google doc) located in admin folder, copy active google doc working on (that blank, if helps).

i quite new @ js, , have been trying use getfilebyid(fileid).makecopy, struggling.

any pointers tutorials should @ or how go doing of great help.

thank you!

open script.google.com document:

tools -> script editor

use function:

function textcopy() {   var doc = documentapp.openbyid('id_of_doc_to_be_copied').gettext();   var body = documentapp.getactivedocument().getbody();   var text = body.editastext();   // insert text @ beginning of document.   text.inserttext(0, doc); } 

run it. permissions asked, sure allow it.

more info doc text manipulation can found in class text.


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -