Hello,
Thanks for your inquiry. After an initial test with the latest version(
Spire.Doc Pack(hot fix) Version:6.3.5), I was unable to reproduce the issue. If you are using an older version, please update to the latest one and try again. If the issue still bothers you, please share us with your full code and input/output documents for further investigation.
In addition, when loading and saving the Word file, the type should be .docm which supports Macros.
- Code: Select all
Document document = new Document();
document.LoadFromFile(@"testMacro.docm", FileFormat.Docm);
document.Replace("Test","changed",true,true);
document.SaveToFile("output.docm", FileFormat.Docm);
Best regards,
Simon
E-iceblue support team