A common practice in SharePoint is to use document libraries that have prebuilt Office document templates associated with them as the content type. When the user clicks in the SharePoint ribbon to create a new document, the assigned document template can be created by default. The user can quickly fill in the template and save it back to the document library.
Historically, you could have document templates that also included a Visual Studio Tools for Office (VSTO) add-in that loaded into a task pane when the document opened. This add-in could virtually do just about anything that any Windows rich-client applications could do, including call Web services, retrieve data from back-end databases, and more. Data retrieval and the ability to then place the retrieved data into the document was a common pattern.
In the following exercise you create a SharePoint-hosted app that has a number of components: an app-level ECT that retrieves employees from an OData source, a document library that has a custom document template for employee referrals, and a document template content type that is a TaskpaneApp for Office and reads the employees in the app-level external list so users can click an employee and load their data into the Word document template.