Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
PdfWriter.GetInstance(doc,
                                          new FileStream(Server.MapPath("~/Upload/") + filename,
                                                         FileMode.Create));


Using this i get the instans of new document add it creates the document with data in , but for doing the same with word document i have tried with

C#
var wordApp = new ApplicationClass();



               Microsoft.Office.Interop.Word.Document myDoc = wordApp.Documents.Add(ref missing, ref missing,
                                                                                   ref missing, ref missing);

               object fileStream = new FileStream(Server.MapPath("~/Upload/") + fileName,
                                                                 FileMode.Create);

               Range rng = myDoc.Range(ref start1, ref missing);


But it only creates the document but there is no data in the document?
Posted

1 solution

Dont remember using filestream for this. HAve a look at the example from the documentation:
http://support.microsoft.com/kb/316384[^]
 
Share this answer
 

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