Click here to Skip to main content
15,884,628 members
Home / Discussions / C#
   

C#

 
GeneralRe: progressbar problem Pin
Guffa22-Apr-06 6:02
Guffa22-Apr-06 6:02 
AnswerRe: progressbar problem Pin
Ravi Bhavnani22-Apr-06 6:07
professionalRavi Bhavnani22-Apr-06 6:07 
GeneralRe: progressbar problem Pin
kasik22-Apr-06 7:07
kasik22-Apr-06 7:07 
GeneralRe: progressbar problem Pin
Ravi Bhavnani22-Apr-06 18:13
professionalRavi Bhavnani22-Apr-06 18:13 
Questionvoice modem and speaker in C# Pin
biruk_haileye22-Apr-06 1:52
biruk_haileye22-Apr-06 1:52 
AnswerRe: voice modem and speaker in C# Pin
Leyu4-May-06 19:38
Leyu4-May-06 19:38 
QuestionExporting word file to text file Pin
Sahar_kh22-Apr-06 1:49
Sahar_kh22-Apr-06 1:49 
AnswerRe: Exporting word file to text file Pin
sujithkumarsl22-Apr-06 6:56
sujithkumarsl22-Apr-06 6:56 
hi Sahar
Try this code. I actually found an article from C-Sharp Corner on how to open up a word file in C#. You just have a look on that article, I added to the code a little to meet ur requirement.


//Create Word Application class.
Word.ApplicationClass app = new Word.ApplicationClass();
//file which you need to convert to text file
object fileName = @"Sample.doc";
//to set the source file readonly.
object readOnly = true;
object missing = Type.Missing;
//to make the document visible.
object visible = true;
app.Visible = true;
app.Documents.Open(ref fileName,ref missing,ref readOnly,ref missing,
ref missing,ref missing,ref missing,ref missing,ref missing,ref missing,
ref missing,ref visible,ref missing,ref missing,ref missing,ref missing);
//select the whole text in Word file
app.Selection.SetRange(0,app.Selection.StoryLength);
//get the selected text, the whole word file content.
string text = app.Selection.Text;
//create StreamWriter Object.
System.IO.StreamWriter writer = new System.IO.StreamWriter("YourTextFile.txt");
//split the text in to lines.
string []lines = text.Split(Environment.NewLine.ToCharArray());
//Iterate over each lines and write to file.
foreach(string s in lines)
{
//write a line to file.
writer.WriteLine(s);
}
writer.Flush();
writer.Close();



My small attempt...
QuestionCrystal Reports viewing Pin
pavanabollineni21-Apr-06 20:13
pavanabollineni21-Apr-06 20:13 
AnswerRe: Crystal Reports viewing Pin
Sean8922-Apr-06 14:56
Sean8922-Apr-06 14:56 
QuestionTextBox databinding problem Pin
wasife21-Apr-06 19:47
wasife21-Apr-06 19:47 
AnswerRe: TextBox databinding problem Pin
tvshkaa22-Apr-06 19:45
tvshkaa22-Apr-06 19:45 
GeneralPut a Chatroom in your site! Free Ajax C#.NET Simple Chat Code. Pin
spilafis21-Apr-06 19:07
spilafis21-Apr-06 19:07 
GeneralRe: Put a Chatroom in your site! Free Ajax C#.NET Simple Chat Code. Pin
leppie21-Apr-06 22:20
leppie21-Apr-06 22:20 
Questionmedia encoder Pin
d_onK21-Apr-06 18:02
d_onK21-Apr-06 18:02 
Questionrecording video clips Pin
d_onK21-Apr-06 17:58
d_onK21-Apr-06 17:58 
Question'Access' a protected Access 97 database with Access 2003 Installed Pin
ndavie21-Apr-06 15:07
ndavie21-Apr-06 15:07 
QuestionComparing Images Pin
clickman21-Apr-06 12:41
clickman21-Apr-06 12:41 
AnswerRe: Comparing Images Pin
eclipse2k122-Apr-06 10:42
eclipse2k122-Apr-06 10:42 
QuestionRead strings between delimiters Pin
kani9821-Apr-06 11:28
kani9821-Apr-06 11:28 
AnswerRe: Read strings between delimiters Pin
Ravi Bhavnani21-Apr-06 11:31
professionalRavi Bhavnani21-Apr-06 11:31 
AnswerRe: Read strings between delimiters Pin
Guffa21-Apr-06 12:55
Guffa21-Apr-06 12:55 
AnswerRe: Read strings between delimiters Pin
sujithkumarsl22-Apr-06 16:47
sujithkumarsl22-Apr-06 16:47 
QuestionHaving a max line count in a list control Pin
BambooMoon21-Apr-06 11:25
BambooMoon21-Apr-06 11:25 
AnswerRe: Having a max line count in a list control Pin
Ravi Bhavnani21-Apr-06 11:30
professionalRavi Bhavnani21-Apr-06 11:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.