now adding text via the TextDocument object, and auto-formatting without opening up any windows