I've got doc.getBody().replaceText(oldregex,newstring)
working fine in a Google Document script at the minute, and was hoping to set some bold/italic on newstring. This looks harder than I thought it would be. Has anyone found a tidy way to do this?
I'm currently thinking I'll need to...
- Build newtext as a range with rangeBuilder
- Find oldtext and select it as a range (somehow...)
- Clear the oldtext range and insert the newtext range at the find location
This seems like a lot of work for something that would be trivial with HTML-like tags. I'm definitely missing something. Would really appreciate any suggestions.