ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  Dot Net  >>  Dot Net Framework
 
 


 

 
 Dot Net Framework interview questions  Dot Net Framework Interview Questions
 Dot Net Remoting interview questions  Dot Net Remoting Interview Questions
 Dot Net WindowsForms interview questions  Dot Net WindowsForms Interview Questions
 Dot Net General interview questions  Dot Net General Interview Questions
 Dot Net AllOther interview questions  Dot Net AllOther Interview Questions
Question
reading doc file in textbox using .net2005 with c#
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: reading doc file in textbox using .net2005 with c#
Answer
# 1
We can use the files concept to load the doc file content
into the textbox using the Multiline property.

we have many ways.This is one of the way.

using System.IO;


FileStream fstream = new
FileStream("Sample.doc",FileMode.Open,FileAccess.Read);
StreamReader sreader = new StreamReader(fstream);

txtFileContent.Text = sreader.ReadToEnd();


->change your Text Box Property into tghe multilien txtbox.
 
Is This Answer Correct ?    3 Yes 10 No
Tiger Skumar
 
  Re: reading doc file in textbox using .net2005 with c#
Answer
# 2
we have to add referance of word document from COM 
referance..
because it only work with .txt files..
 
Is This Answer Correct ?    4 Yes 3 No
Sachin
 
 
 
  Re: reading doc file in textbox using .net2005 with c#
Answer
# 3
ApplicationClass WordOper = new ApplicationClass();
String filePath = Server.MapPath("../Files/Book.doc");
Object file = filePath;
object nullobj = System.Reflection.Missing.Value;
Document doc = WordOper.Documents.Open(ref file, ref
nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj, ref nullobj);
Document doc1 = WordOper.ActiveDocument;
string m_Content = doc1.Content.Text;
TextBox1.Text = m_Content;
doc.Close(ref nullobj, ref nullobj, ref nullobj);
 
Is This Answer Correct ?    1 Yes 1 No
Anand
 

 
 
 
Other Dot Net Framework Interview Questions
 
  Question Asked @ Answers
 
What is strong name?  4
what are partial classes? HP11
what is Framework?  1
What is serialization ? MMTS4
im software developer (.net). i goth1b (usa )appointment 30th of this month . chennai people asking responsbilities .can anyone wht responsbilities i need say . plz help me  2
What is JIT and how is works ?  4
what is VSS? Where we are using? TCS2
If you are using components in your application, how can you handle exceptions raised in a component ? Accenture3
What is side by side Execution ? MMTS3
Tell me about the internal working of Garbage collector? Honeywell2
Httpcontext objects? HP2
What is the common property in .net? Nth-Solution1
More on CLR ? MMTS2
What is "out" parameter how it is used in methods? Polaris6
About namespaces ? MMTS2
what is Thread Priority?  1
what is a round trip?What is a postback? Bosch2
please tell me the best book of asp.net in the markit. which explain in simple and detail.  2
If we write return statement in finally block will it works fine or throws any error? Kanbay5
Features in .net framework 1.1 ? Digital-GlobalSoft1
 
For more Dot Net Framework Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com