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                      
tip   SiteMap shows list of All Categories in this site.
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
 
Httpcontext objects? HP2
If you are using components in your application, how can you handle exceptions raised in a component ? Accenture3
What is Global Assembly Cache (GAC) and what is the purpose of it?  2
In which circumstances you used delegates? HP3
Requirement is: try { \\SQL Query } catch(Exception i) { print a } catch(SQLQueryException e) { \\SQL Query } Qu)I Got Exception in "try" block. Which "catch" statement (i.e. 1st catch or 2nd catch ) catches the exception and Why??? 3i-Infotech3
what are background threads? give ex? Kanbay3
If we not suppress finalize method in dispose what will happen? Kanbay1
what is Thread Priority?  1
how many ways for pass the parameters in the fuction in c#  3
What are the properties of Thread class?  1
How do you sort a dataset?  2
What is the necessity for singning an assembly with a strong name? L&T1
What are the ways to deploy an assembly?  1
What is the difference between STA and MTA?  2
What are the methods in Thread class?  1
If we want to construct our own Garbage collector what are the steps things we have to do? Honeywell3
How to add 'ASPNET.mdf' file into server explorer in visual studio 2005?  2
What is a serverside technology? what is a clientside technology? what is a clientserver technology? what is a internet based application? what is a intranet based application? what is a windows application? what is a console application? Difference between console application and windows application? IBM3
Integer & struct are value types or reference types in .NET?  3
what is VSS? Where we are using? TCS2
 
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