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 Jan 09, 2020 2:13 pm

Hello, i am trying to use the spire word.doc dll. Unfortunately I am getting the error as you can see atteched.
Translated: spire.Doc.Fileformat does not contain a definition for txt.

thanks a lot for an idea how to solve the issue

MaikelFra
 
Posts: 5
Joined: Thu Jan 09, 2020 12:18 pm

Fri Jan 10, 2020 2:46 am

Hi,

Thanks for your inquiry.
Kindly note that the definition of the Text file in "SaveToFile" method is "Txt" instead of "txt". Please modify your code as below to convert a Word file to a Text file.
Code: Select all
            Document document = new Document();
            document.LoadFromFile(@"..\filename.doc");
            document.SaveToFile("result.txt", FileFormat.Txt);

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Fri Jan 10, 2020 7:22 am

Hi, thanks for your answer but I am still getting the same error
Please find attached. In the FileFormat list "Txt" will not provided. There are only filetypes with D (like docx etc.), O and W in the list.

Best regards

Maikel

MaikelFra
 
Posts: 5
Joined: Thu Jan 09, 2020 12:18 pm

Fri Jan 10, 2020 9:30 am

Hi,

Thanks for your reply.
Please make sure that you are using the latest version of Spire.Doc Pack Version:8.1.
If the issue still exists, to help us investigate it accurately, please offer us a runnable project which could reproduce your issue directly. You could upload it here or send us(support@e-iceblue.com) via email.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Mon Jan 13, 2020 9:28 am

Thanks a lot, with a version update, it works.

MaikelFra
 
Posts: 5
Joined: Thu Jan 09, 2020 12:18 pm

Mon Jan 13, 2020 9:36 am

Hi,

Thanks for your feedback.
Any question, welcome to contact us.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Return to Spire.Doc