Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Mon Mar 26, 2018 5:02 pm

I am using Spire.Doc with .Net C # to replace a word in a word document, but I am finding it difficult to save the file without losing the macros programmed in VB.net please someone to help me?

yagod859c#
 
Posts: 2
Joined: Mon Mar 26, 2018 4:55 pm

Tue Mar 27, 2018 8:08 am

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
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Tue Mar 27, 2018 12:07 pm

Hello, I tried the method that I passed most unhappily did not work to save the document in the format Document the impedance file to open the same and I can not emulate a .dll because I use a free version of Spire.Doc then give me a viable solution stayed without waiting

yagod859c#
 
Posts: 2
Joined: Mon Mar 26, 2018 4:55 pm

Wed Mar 28, 2018 3:15 am

Hello,

Thanks for your reply. The free version also works well on my side. To help us investigate the issue, would you please share us with your full code, input and output Word files? You could zip them and attach here or send to support@e-iceblue.com.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Fri Mar 30, 2018 8:07 am

Hello,

Greeting from E-iceblue.
How is the issue going?
We will appreciate it if you could give us some feedback.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Return to Spire.Doc