It looks like the problem may be due to bookmark/link processing starting before the text is completely inserted into the new document (newDoc). There may be some asynchronous delay or process occurring when the code first runs that prevents the text from being fully inserted before it is processed.
|