0

Is there a way to access the dom of the active document(doc/docx) in google app script? I only managed to get the body of the document as text.

tehhowch
  • 9,645
  • 4
  • 24
  • 42
Gabriel Terry
  • 55
  • 1
  • 6

1 Answers1

0

You may refer with this post which suggested to use the XML service that allows scripts to parse, navigate, and programmatically create XML documents. Here's an additional reference which might also help: Does Google Apps Script have something like getElementById?

abielita
  • 13,147
  • 2
  • 17
  • 59
  • Thank you for the answer, I already tried that one. I found a workaround to get and parse the text as a string. The only problem that I have now is that the getCursor() function returns only the position of the cursor in the current row. (I'm on row 3 and at position 54 it will only return 54, nothing about the row to be able to get all the text before the cursor position) – Gabriel Terry Aug 09 '18 at 06:57