Hi Marcelo,
Thank you for contacting Syncfusion support.
Essential DocIO library doesn’t have a support to write the Macros in the Word document. Currently, we have a support to load and save macros enable Word document and remove the macros from macros enable Word document.
Please refer the below link to know more about Macros.
https://help.syncfusion.com/file-formats/docio/working-with-macrosThe following link shows how to create a macro in the Word document.
https://support.office.com/en-in/article/Create-or-run-a-macro-c6b99036-905c-49a6-818a-dfb98b7c3c9cIf your requirement is to create Word document and insert the macros into this and save as “.docm” format document using DocIO means, then DocIO doesn’t have a support for the same. We have already logged this request as feature in our end.
We will consider implementing this feature in any of our upcoming releases. We usually have an interval of at least three months between releases. The feature implementation would also greatly depend on the factors such as product design, code compatibility and complexity. At present, we are unable to provide any concrete timeline for implementing this feature. We will update you when this feature has been implemented.
It can be tracked through our feature management system:
https://www.syncfusion.com/feedback/3095/support-for-inserting-and-modifying-macros-in-a-word-documentOtherwise, if your requirement is to convert text file to “*.docm” format document without adding any macros means, the use the below code example.
|
//Opens the template document WordDocument document = new WordDocument(@"Template.txt"); //Saves and closes the WordDocument instance document.Save("output.docm", FormatType.Docm); document.Close(); |
If we misunderstood any of your requirement, please share the complete requirement. So that we will validate and provide the solution earlier.
Please let us know if you have any other questions.
Regards,
Manikandan Ravichandran