Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files from any .NET platform (C#, VB.NET, ASP.NET, .NET Core) and Java applications (J2SE and J2EE) with fast and high quality performance.

Fri Nov 23, 2012 10:20 am

Hello,

I was thinking that someone may not have MS Word installed, and will try to open the documents from my application with Open Office. Somehow, i get an error "This is not a winword97 file".
If i open this file with Word, and save it again, OpenOffice will open it, but not directly, as it is generated from Spire.Doc.
I assume that this error occurs because of the html code inserted in the document.
The document is created through the AppendHTML function, apparently this thing is not supported by OO. What curious is though, is that after the document is opened with Word and re-saved, OO will open it.

Do you know any trick, through i can make this thing work? :)

catalin
 
Posts: 48
Joined: Wed Mar 14, 2012 12:56 pm

Mon Nov 26, 2012 5:59 am

Hi catalin,

Thanks for your inquiry.
We are sorry for the delay response for the weekends here.
About your problem, we think that it may be caused by the decimal separator of your local culture. We provide you a method to resolve this problem. Please try it, and tell us how it works. If you still have the problem, could you please provide us a simple project which can reproduce your problem? If the project don't include the dlls of spire.doc , could you please tell us the dlls version you used? So that we can reproduce your problem, and work out a solution for you again. Thank you!
Code: Select all
            Document document = new Document();
            Paragraph p= document.AddSection().AddParagraph();
            p.AppendHTML(@"
            <ol>
               <li>Coffee</li>
               <li>Tea</li>
               <li>Milk</li>
            </ol> ");

            CultureInfo cc = Thread.CurrentThread.CurrentCulture;
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

            document.SaveToFile("sample.doc", FileFormat.Doc);

            Thread.CurrentThread.CurrentCulture = cc;


Best regards,
Amy
E-iceblue support
User avatar

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

Tue Jan 05, 2016 9:27 am

Hello,

I am having the same issue. The given solution did not work for me and I do not know what to do.

PD: sorry about my english and the short answer :)

Saludos,
Antonio

amondejar
 
Posts: 2
Joined: Tue Jan 05, 2016 8:28 am

Tue Jan 05, 2016 9:40 am

Hello,

Please attach the sample codes you were trying for our investigating.

Thanks,
Gary
E-iceblue support team
User avatar

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

Tue Jan 05, 2016 12:01 pm

Hi, here is my code:
Code: Select all
 public override void generarCurriculum(PERSONAL personal, string file_path, string file_name)
        {
            Document cvOrig = new Document();
            cvOrig.LoadFromFile(file_path + "/" + file_name, FileFormat.Doc);

            string nombreDocumento = file_path + "/MERGED_" + personal.LOGIN.ToUpper() + "_CV.doc";
            try
            {
                CultureInfo cc = Thread.CurrentThread.CurrentCulture;
                Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

                cvOrig.SaveToFile(nombreDocumento, FileFormat.Doc);

                Thread.CurrentThread.CurrentCulture = cc;
            }
            catch (Exception e) /* Si en el servidor está abierto el archivo MERGED */
            {
                e = new Exception(Constantes.ERROR_CV_MERGEDOCUPADO);
                throw e;
            }
        }
    }


Thanks for your help
Antonio

amondejar
 
Posts: 2
Joined: Tue Jan 05, 2016 8:28 am

Wed Jan 06, 2016 2:51 am

Hello,

Thanks for the information. The lower version our product supports is 03, our product doesn't support 97version.

Sincerely,
Gary
E-iceblue support team
User avatar

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

Wed May 11, 2016 8:28 am

I have a same issue with OpenOfice 4.1.2.
There is doc file as a template. It opens by OpenOffice. I replace words programly
Code: Select all
doc.Replace("***" + item.Key + "***", item.Value, false, true);

by Spire.Doc and save using
Code: Select all
doc.SaveToFile(fileName), Spire.Doc.FileFormat.Doc);

After that result doc file is not opening by OpenOffice with error "This is not a winword97".
How do i fix it?
P.S. the current culture setting is not working for me

vksoft
 
Posts: 4
Joined: Mon Mar 07, 2016 8:18 am

Wed May 11, 2016 9:29 am

Hello,

Thanks for your feedback.
Could you please share your doc file can replicate your issue with us to do a investigation?

Thank you in advance.
Caroline
E-iceblue support team
User avatar

caroline.zhang
 
Posts: 291
Joined: Mon Mar 07, 2016 9:22 am

Wed May 11, 2016 9:08 pm

caroline.zhang wrote:Could you please share your doc file can replicate your issue with us to do a investigation?


Yes, they are.
Two files: template document and result with opening error
You do not have the required permissions to view the files attached to this post.

vksoft
 
Posts: 4
Joined: Mon Mar 07, 2016 8:18 am

Thu May 12, 2016 3:38 am

Hello,

Thanks you for your files.
I have tested the template document and noticed your issue. I have forwarded it to our dev team. Once it is resolved, we will inform you the first time.

Sincerely,
Caroline
E-iceblue support team
User avatar

caroline.zhang
 
Posts: 291
Joined: Mon Mar 07, 2016 9:22 am

Fri May 13, 2016 1:43 pm

Could you say, how long your investigation will be?
My clients and I are waiting the results with Hope.

vksoft
 
Posts: 4
Joined: Mon Mar 07, 2016 8:18 am

Mon May 16, 2016 7:40 am

Hi,

Thanks for waiting.
The issue has been resolved. Please download and test new version, Spire.Doc for .NET Standard Edition Version:5.7.9.

Best Regards,
Amy
E-iceblue support team
User avatar

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

Tue May 17, 2016 2:04 pm

Thanks a lot!
The new version has solved the issue!

vksoft
 
Posts: 4
Joined: Mon Mar 07, 2016 8:18 am

Wed May 18, 2016 1:30 am

Hi,

Glad to hear from you.
Welcome to write to us again if you have further problems.

Best Regards,
Amy
E-iceblue support team
User avatar

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

Return to Spire.Doc