Applying a new document template to an existing document