Good day ,
You can use Power Automate or Logic Apps for the task. In the following link you have a full example of filling word template:
https://tahoeninjas.blog/2020/03/13/generate-word-documents-from-a-template-using-power-automate/
Basic architecture can be:
(1) create word template and store it online in OneDrive for Business, SharePoint Online Sites, or Office 365 Groups.
(2) when the form is send then trigger the logic apps and pass the information from the form. Note that if you are using Microsoft forms then then this can be done directly with logic apps using the דubmitting םכ the form as the trigger that executes the app.
(3) In the logic apps (or Power Automat) you can fill the template and create and store as new file or send it by email
If you need option to re-edit the document then you can store the information in SQL Server before you create the file and when you need to edit it then you can read the data from the database -. add the missing information -> and do the same to create a new file or send it
Recommend to read this documentation about the Word online:
https://learn.microsoft.com/en-us/connectors/wordonlinebusiness/