0

I'm trying to make a little text analyzer using Google Apps script. I'd like to be able to read an entire Google Doc as a text string. I've tried using the editAsText() and getDataAsBlob() functions but neither seem to be returning the document text as readable string data. Does anyone have any suggestions on how to do this using a Google Apps Script?

Many thanks,

Mogsdad
  • 44,709
  • 21
  • 151
  • 275

1 Answers1

1

Try like this:

var doc = DocumentApp.getActiveDocument(); 
var text = doc.getBody().getText();// get a string
Serge insas
  • 45,904
  • 7
  • 105
  • 131