How can i read .doc document in ASP.Net?

----

Showing Answers 1 - 3 of 3 Answers

prasanna V

  • Oct 17th, 2005
 

using Microsoft Office Object Library

  Was this answer useful?  Yes

vishal sharma

  • Mar 5th, 2006
 

you can read from a text file like this.

private void Button12_Click(object sender, System.EventArgs e)

{

string path="C:\\Inetpub\\new1.txt";

using(StreamReader reader=new StreamReader(path))

{

string line;

while ((line=reader.ReadLine())!=null)

{

Label2.Text+="<br>"+line;

}

}

}

from .doc file try yourself

  Was this answer useful?  Yes

Diju

  • Mar 15th, 2006
 

Private Sub button1_Click(sender As Object, e As System.EventArgs)' Use the open file dialog to choose a word documentIf Me.openFileDialog1.ShowDialog() = DialogResult.OK Then' set the file name from the open file dialogDim fileName As Object = openFileDialog1.FileNameDim readOnly As Object = FalseDim isVisible As Object = True' Here is the way to handle parameters Dim missing As Object = System.Reflection.Missing.Value' Make word visible, so you can see what's happening WordApp.Visible = True' Open the document that was chosen by the dialogDim aDoc As Word.Document = WordApp.Documents.Open(fileName, missing, [readOnly], missing, missing, missing, missing, missing, missing, missing, missing, isVisible) ' Activate the document so it shows up in front aDoc.Activate();' Add the copyright text and a line breakWordApp.Selection.TypeText("Copyright C# Corner")WordApp.Selection.TypeParagraph()End IfEnd Sub 'button1_Click

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions