Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > .NET Framework 1.x
|
.NET Framework 1.x For discussing versions 1.0 and 1.1 of the Microsoft .NET Framework.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 1.x section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 29th, 2006, 01:38 PM
Registered User
 
Join Date: Aug 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to amol.mahajan85@gmail.com
Default Reading .Doc File in ASP.NET 1.0/1.1

Hi,
  Any one knowns how to open and read a .doc file into .net!!
I am trying for this code from months...but i cant...
Any one can help..!!!


 
Old August 31st, 2006, 02:22 AM
Registered User
 
Join Date: Aug 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to amol.mahajan85@gmail.com
Default

ok...my self get the solution for these...

 
Old September 7th, 2006, 12:50 AM
Registered User
 
Join Date: Aug 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to amol.mahajan85@gmail.com
Default


I am getting to much mails for this problems answer so i am pasting this solution here only,,,
  Only problem to this code is that ..it dosent preserves the formatting for the doc files, if any one finds that plz do reply.
Thanks,

Good Luck....

  All before add reference of COM object >>>> Microsoft Word 10.0 Object Library
this is the code....>>

using System.Runtime.InteropServices;
using Word;
private void Button3_ServerClick(object sender, System.EventArgs e)
{
Word.Application obj_app=new ApplicationClass();
Word.Document obj_doc=new DocumentClass();
object readOnly = false;
object isVisible = true;
object missing = System.Reflection.Missing.Value;
object filepath=(@"c:\Resume.doc"); //file to be read
obj_doc=obj_app.Documents.Open(ref filepath,
ref missing,ref readOnly,
ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing,
ref missing, ref missing, ref isVisible,
ref missing,ref missing,ref missing);
obj_doc.Select();

Response.Write(obj_app.Selection.FormattedText.Tex t);

obj_doc.Close(ref missing,ref missing,ref missing);
obj_app.Quit(ref missing, ref missing, ref missing);
}






Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing .doc file in asp automatically vishalres Classic ASP Professional 3 April 9th, 2007 05:56 PM
Reading/Amending .doc File Properties turklet ASP.NET 2.0 Basics 1 December 14th, 2006 01:08 PM
How to read *.doc file in asp.net satish1234 ASP.NET 1.0 and 1.1 Professional 2 August 8th, 2006 05:32 AM
Reading word file in asp.net 1.1 anujrathi ASP.NET 1.0 and 1.1 Professional 0 August 4th, 2006 01:09 AM
Parse XML doc using VB.NET into ASP.NET page kwilliams Classic ASP XML 17 November 11th, 2005 10:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.