Hi!
I believe you should be able to do so. Is it a viable option to copy that function and place it on the “Custom File Content” setting (see screenshot) with correct file name (myfile.docx etc), and mime type
(application/vnd.openxmlformats-officedocument.wordprocessingml.document for docx)?
