Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
General Input/Output Error Problem help me

Im generating docx file using Open XML

When i open the file in Oppenoffice,org Writer

its throw General Input/Output Error

My code

C#
public void WordprocessingFromString(string InputPath, string OutputPath, string InputDir)
        {          
            using (WordprocessingDocument myDoc = WordprocessingDocument.Create(OutputPath, WordprocessingDocumentType.Document))
            {
                MainDocumentPart mainPart = myDoc.AddMainDocumentPart();                mainPart.Document = new Document();
                Body body = new Body();
                Text heading_text = new Text("Test by amal..");
                ParagraphProperties heading_pPr = new ParagraphProperties();
                body.Append(heading_text);
                mainPart.Document.Append(body);
                mainPart.Document.Save();
            }
        }


Thanks in advance
Posted
Updated 20-Mar-14 22:22pm
v3
Comments
Tejas Vaishnav 21-Mar-14 3:01am    
can you use improve question functionality and add your some lines code...
Amalraj Ramesh 21-Mar-14 3:42am    
pls verify my code
Tejas Vaishnav 21-Mar-14 4:23am    
from which line you got the error
ZurdoDev 21-Mar-14 6:38am    
If you google the error you will get lots of results.

Which line of code causes the error?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900