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.

Thu May 02, 2013 1:29 pm

Hi,
I've just installed latest version of Spire.doc standard Edition 4.7.19.53040 and the method

document.SaveToFile(fileNameTemp, FileFormat.Docx);

doesn't work properly.

It works only if fileNameTemp already exists (the file is overwritten) but if fileNameTemp does not exist no file is created.

With the previous installed version 4.6.0.3040 it worked fine


Could you help?

Regards.

gmb
 
Posts: 5
Joined: Tue Jan 08, 2013 2:28 pm

Fri May 03, 2013 2:47 am

Hi,

Thanks for your inquiry.

Sorry for inconvenience, if fileNameTemp does not exist no file is created, the version of Spire.doc standard Edition doesn't support the method document.SaveToFile(fileNameTemp, FileFormat.Docx), and you could use the method document.SaveToStream(stream, FileFormat.Docx); In regards to the issue, we will fix it in the next version. If you would use the method document.SaveToFile(fileNameTemp, FileFormat.Docx), please download the Spire.doc pro version from the link that http://www.e-iceblue.com/Download/download-word-for-net-now/spiredoc-pack-hot-fix4722.html?Itemid=0

Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Tue May 07, 2013 9:29 am

Dear gmb,

Please test SaveToStream(ms, FileFormat.Docx) method of Spire.doc standard Edition 4.7.19. I attached some code below.
Code: Select all
using (MemoryStream ms = new MemoryStream())
            {
                Document document = new Document();
                Section section = document.AddSection();
                section.AddParagraph().AppendText("Hello World!");
                document.SaveToStream(ms, FileFormat.Docx);
                File.WriteAllBytes("sample.docx", ms.ToArray());
            }


We will inform you as soon as the new standard Edition which fixes SaveToFile(fileNameTemp, FileFormat.Docx) method is released.

Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Wed May 08, 2013 10:23 am

Hi,
I changed my code to use SaveToStream method and it works.


Regards.

gmb
 
Posts: 5
Joined: Tue Jan 08, 2013 2:28 pm

Return to Spire.Doc