Error in makeCopy function ( Google App Script ) // PDF generator

722 views
Skip to first unread message

Grégory BONDEL

unread,
Mar 5, 2022, 8:32:36 AM3/5/22
to Google Apps Script Community

I am a Google App Script beginner.


My script purpose is to create a .PDF document using a Google doc with variables.


At line 19 , I have an error showing at this line :

const newTempFile = templateDoc.makeCopy(tempFolder);

Here is the error message

Capture d’écran 2022-03-04 à 11.18.23.png


It s stating that templateDoc.makeCopy is not a function


How can I fix this error ?

here is my code

Capture d’écran 2022-03-04 à 14.51.28.png

Thank you for your help

Jonathan Butler

unread,
Mar 5, 2022, 11:36:57 AM3/5/22
to google-apps-sc...@googlegroups.com
Change line 17 to getFileById instead of getFolderById

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/64be6ada-2655-4868-a85d-bd3e9cc7b367n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages