What you're trying to achieve is not currently implemented yet in DocumentApp. It was also asked by a community member from another forum last March 2023. And someone filed this as a featured request, but the requester is not active, which is the reason why the featured request was closed.
I would encourage you to send this as a new feature request by going to this link. The feedback submitted there will go directly to the development team, and the more people who request a feature like this, the more likely it will be implemented.