Is there a way to enter the parameters collected in a document without using that API?
Assuming that by doc (x) you refer to a .doc or .docx file, it is possible but it generally does not make sense to "reinvent the wheel".
The .doc format is a binary format, the .docx format is a "composite" format, since it is a compressed file that includes several files of which the main ones are XML files and the rest are resources, for example, images.
- Obtain the .docx file and the data provided by the user
- Unzip the .docx file and select the main file.
- Repeat for each element:
- If the structure is known, then use select the element and insert the content provided by the user.
- If the structure is not known, there must be a map or dictionary that establishes the relationship of the data provided by the user with its location in the document.
- Compress the files in a new .docx
- Save the new .docx file
It is worth mentioning that Microsoft Word has the ability to create forms and insert fields to display both built-in and custom properties, protect the document and protect fields, etc. however, not all editors that .doc and .docx files can handle files in which these features are used, besides that this could "complicate" the code because those elements should be considered.