473,385 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Retrieve word in browser in c#

I need to retrieve word document into browser for print. I used the following code, yet im unable to add com reference for the Microsoft Word 9.0 Object Library. I use Visual studio 3.5. i found Microsoft Word 11.0 Object Library which is not supportng word application class.what shud i be doing.


Word.ApplicationClass wordApp = new ApplicationClass();
object file = path;
object nullobj = System.Reflection.Missing.Value;
Word.Document doc = wordApp.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);
doc.ActiveWindow.Selection.WholeStory();
doc.ActiveWindow.Selection.Copy();
IDataObject data = Clipboard.GetDataObject();
txtFileContent.Text = data.GetData(DataFormats.Text).ToString();
doc.Close();
Apr 3 '10 #1
0 1206

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Joan | last post by:
I am creating a word document from an asp page. I have no problems actaully creating the document and creating some tables that have data in them. I am using Response.ContentType =...
17
by: Mike | last post by:
I am trying to write a web page where a person can click on a word document and MS Word is launched instead of the document being displayed in the IE browser. I have been able to launch MS Word but...
1
by: Eugfene | last post by:
I have the following function in a html file: function selectEdit(fileID, processCode, processID, fileName,fileDesc) { document.forms.recordID.value = fileID; document.forms.processor.value =...
3
by: John Smith | last post by:
Hey folks, I've got a Windows C# application that generates a .doc file and then allows the user to preview it. I generate the file using the StreamWriter class and do a flush() and a close()...
5
by: aolson | last post by:
First of all i am pretty new to VB .NET as a whole so my answer may be silly as may my questions. Here is what i would like to do. I would like to open potentially multiple word documents for...
2
by: adam | last post by:
Hi ASP Expert, My goal is to retrieve my local machine's %USERNAME% environment variable from ASP page. When I enter http://RemoteServerName/testusername.asp?id=%USERNAME% directly into the IE...
2
by: =?Utf-8?B?c2NvdHRybQ==?= | last post by:
Hi I am using a SQL Server 2005 varbinary(max) to store word documents in the database. I can retrive the data out into a MemoryStream object ok but I want to be able to use this to display the...
7
by: teo | last post by:
Hallo, I'd like to retrieve the pixel length of a string. ------------------------ I decided to use MeasureString, but I have a problem with the graphic "instance" of it. I'm in a Sub and
0
by: alivip | last post by:
I write code to get most frequent words in the file I won't to implement bigram probability by modifying the code to do the following: How can I get every Token (word) and ...
5
by: alivip | last post by:
How can I get every Token (word) and PreviousToken(Previous word) From multube files and frequency of each two word my code is trying to get all single word and double word (every Token (word) and...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.