#3193443: Open and close the document for writing operations
Open the document before performing the writing on the document. Also closing it after writing
Open the document before performing the writing on the document. Also closing it after writing