Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

191
Views
Cómo recuperar el contenido aceptado por todas las sugerencias de un documento en Google Doc a través de la API

Como título, logro recuperar todo el contenido aceptado por sugerencia en Google Docs a través de la API. Me he referido asu guía y a un par de publicaciones en esta plataforma, pero fue en vano. A continuación se muestra el fragmento que tengo actualmente. Por favor avise.

 function myFunction() { var documentId ="My file ID"; var doc = Docs.Documents.get(documentId); var SUGGEST_MODE= "PREVIEW_SUGGESTIONS_ACCEPTED"; var doc1 = Docs.Documents.get(documentId).setSuggestionsViewMode(SUGGEST_MODE); console.log(doc1.body.content) }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Al ver la documentación, debe usarlo así

Guion:

 function myFunction() { doc_id = '1s26M6g8PtSR65vRcsA90Vnn_gy1y3wj7glj8GxcNy_E'; SUGGEST_MODE = 'PREVIEW_SUGGESTIONS_ACCEPTED' suggestions = Docs.Documents.get(doc_id, { 'suggestionsViewMode': SUGGEST_MODE }); new_content = ''; suggestions.body.content.forEach(obj => { if(obj.paragraph) obj.paragraph.elements.forEach(element => { new_content += element.textRun.content; }); }); console.log(new_content); }

Sugerencias de muestra (con párrafo agregado):

muestra

Producción:

producción

EDITAR:

  • Agregué un párrafo adicional y, en lugar de solo registrarlos, los almacené en una sola variable y los imprimí al final.

Referencia:

  • documentos.obtener
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!