Using Microsoft.Office.Interop.Word To Convert Uploaded Word Documents Into Previewable Html Files?
Feb 3, 2010
I'm hoping this is an easy one...I'm using Microsoft.Office.Interop.Word to convert uploaded word documents into previewable html files. I haven't implemented it fully, but I've played around with it enough that I think I have a plan that will work... My question revolves around
[Code]....
I'm not in love with the idea of opening word and closing it everytime there's an upload (which I hope is a lot of the time) I'd like to make this a shared object that loads at application start. I have 2 questions
that go along with this. 1. I imagine that winword could lock up and that would be a problem, right? 2. to save a document I use wordapp.ActiveDocument, this could have an issue as a shared object, right? I think I'm talking myself right out of this...
View 1 Replies
Similar Messages:
Mar 25, 2010
I'm having some difficulty merging multiple word documents together using Microsoft Office Interop Assemblies (Office 2007) and ASP.NET 3.5. I'm able to merge the documents, but some of my formatting is missing (namely the fonts and images). My current merge code is shown below.
private void CombineDocuments() {
object wdPageBreak = 7;
object wdStory = 6;
object oMissing = System.Reflection.Missing.Value;
object oFalse = false;
object oTrue = true;
string fileDirectory = @"C:documents";
Microsoft.Office.Interop.Word.Application WordApp = new Microsoft.Office.Interop.Word.Application();
Microsoft.Office.Interop.Word.Document wDoc = WordApp.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
string[] wordFiles = Directory.GetFiles(fileDirectory, "*.doc");
for (int i = 0; i < wordFiles.Length; i++) {
string file = wordFiles[i];
wDoc.Application.Selection.Range.InsertFile(file, ref oMissing, ref oMissing, ref oMissing, ref oFalse);
wDoc.Application.Selection.Range.InsertBreak(ref wdPageBreak);
wDoc.Application.Selection.EndKey(ref wdStory, ref oMissing);
}
string combineDocName = Path.Combine(fileDirectory, "Merged Document.doc");
if (File.Exists(combineDocName))
File.Delete(combineDocName);
object combineDocNameObj = combineDocName;
wDoc.SaveAs(ref combineDocNameObj, ref m_WordDocumentType, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
}
I don't care necessarily how this is accomplished. It could output via PDF if it had to. I just want the formatting to carry over.
View 1 Replies
Feb 21, 2011
I have been using using Microsoft.Office.Interop.Word in my webserver (yes, i know it is not recommended). When I ran it on my machine, it runs fine, but when running on the server I get a timeout on the following line:Documents.Open //when trying to open the file.Is there something I'm missing? Is there a better way to edit a Word document within web servers/websites? (I can't create a new one using string builder or outputting into file; I need to edit an existing one that sits on the server.)
View 1 Replies
Dec 10, 2010
I am having an issue that I do not quite understand. I had an ASP project that I built using
Code:
<add assembly="Microsoft.Office.Interop.Word, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C"/>
while I still had Office 2007 still on my development PC. I recently upgraded to Office 2010 and even though the web.config file still remains with the above assembly reference, when I publish it and run it now i keep getting the following error ...
Quote:
Could not load file or assembly 'Microsoft.Office.Interop.Word, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.
I also have installed the PIA for Version=14.0.0.0 on the server but I still get the same result.
View 12 Replies
Feb 25, 2016
I have QuestionTable.
ID Question Answer1 Answer2 Answer3 Answer4
But I want import from MS Word into table. I have question like this:
Question: @1.The capital of India.
Answer:$A) Dushanbe;$B) Moscow;$C) Delhi;$D) Kabul;
@2.The capital of Tajikistan.
$A) Dushanbe;$B) Moscow;$C) Delhi;$D) Kabul;
@3.The capital of Afganistan.
$A) Dushanbe;$B) Moscow;$C) Delhi;$D) Kabul;
Output result:
ID Question Answer1 Answer2 Answer3 Answer4
1 1.The capital of India. A) Dushanbe; B) Moscow; C) Delhi; D) Kabul;
View 1 Replies
Jan 20, 2011
'DataTable' is an ambiguous reference between 'System.Data.DataTable' and 'Microsoft.Office.Interop.Word.DataTable'
View 3 Replies
Dec 9, 2010
My server administrator does not allow me to install Microsoft Office in the server.
I have developed a website which converts XML files to Excel and it is using Microsoft.Office.Interop.Excel.
Is there any way I can run this application without installing Microsoft Office in the server?
View 7 Replies
Jan 30, 2010
How to read doc, docx file into .NET with C#.
View 5 Replies
May 10, 2010
I would like to convert Word document to an Image so i can use iTextSharp to then convert the image to PDF.
View 1 Replies
May 11, 2010
i have an aspx page with one button on it the name of the page is Default.aspx
i have a physical microsoft office word file in the c drive
what i want to do is that when i press a button i open a microsoft office word located on the c drive then i add some text to it using c# code
then i want to open the file (that i edited and located in memory) in mircosoft office word to see the text that i have added
everything works fine but when i press the button i get a prompt that says do you want to open the file or save it .
questions:
so how can i directly open the file (located in memory) in microsoft office word without this prompt
also if i choose open from the prompt the file opens in the read only mode and the title of the file in the microsoft word become the name of the aspx page which is Default.aspx
so what is going wrong here
[Code]....
View 2 Replies
Feb 25, 2010
I am creating a pivot table excel sheet in my ASP .NET web application using Microsoft Office Interop Excel 12.0 components. It is creating the excel file correctly, when i run it from my Visual Studio 2008 in Debug/Release mode.
But when i deploy the solution in IIS 7, first i got some permission issues, which i resolved by giving permission in the DCOMCNFG file. Now i am getting the following error, when trying to open the Excel file:
[code]....
These are the code which i used to open and close the excel application object
[code]....
View 1 Replies
Sep 6, 2010
I wrote some code about sending mail, Task, Appoinment etc. For example you can add someone to your outlook contact list over asp.net page. Every thing is ok on my local machine. But if I publish my application to a server I can not add noone on my outlook.
View 2 Replies
Jan 27, 2010
I wanto to create matrix report dynamically using Microsoft.Office.Interop.Excel.dll so that i can create pivot table and Report from this, how i can create these kind of repots where in user will drag and drop the details and it will create reports.
View 2 Replies
Apr 15, 2010
any component or library (preferably open source) that would allow me to convert Word 2007 documents to Word 2003 with ASP.NET?
View 3 Replies
Sep 2, 2010
I'm a student doing final year of my Computer Science and Engineering. For my final year project i've choosen to do an online word processor such as google docs,zoho etc.I want to implement this project in .net. This will be a ajax oriented project and i'm well prepared with the web related part of it with ASP.net and C#.net at the server end and HTML,Javascript at the front end. But the point where i'm struck up is:
-> How can i create, edit and add MS Word features to a .doc file using VB.net or C#.net??
-> .net Library classes that will be helpful for me to create word related components as .doc files i.e how to create word using .net?
-> How can i convert a .doc file to HTML file to display it on a web browser?
-> In brief tell me how to create a word processor so that i'll be able to create it online.
View 1 Replies
Apr 12, 2010
I have a problem i need to convert my current html Pages which shows some report to word document.how to convert html to word file in vb code.
View 1 Replies
Sep 21, 2010
How can I convert HTML to Word Document in ASP.NET?
View 2 Replies
Nov 30, 2010
I have a docx (also in pdf format) that i have to put up on a site. Well word completely junks it up I spent 4 hrs fixing one file and my next one is bigger.
View 3 Replies
Jan 27, 2011
I have a wcf web service that uses the Word interop to produce documents. All works fine when I run it in visual studio, but when I host the web service in IIS (as it will eventually be on a server) and call it there it will fire up WINWORD.exe but then hangs on a call to the "_WordApp.Documents.Add" method and then times out. I realise that the difference between me running in VS and IIS is that in IIS it will now be running as ASPNET user and I have taken the following steps to try and fix this problem.
I used DCOMCNFG to allow permission for ASPNET on "Microsoft Office Word 97 - 2003 Document" (which I thought was strange as I have Office 2007 installed) and this got me past an earlier error that was stopping me instantiating Word, but then I got stuck where I am now.I then tried using impersonation in the web config to get Word to run as my user (as it does when using VS) but it still runs as ASPNET I've heard that this is because the first time a user fires up Word it pops up a modal form asking you to confirm your name and initials, and because ASPNET hasn't run Word before then I somehow need to get past this form. How can I login as ASPNET to do this? Does this sound right? If I can't do this, how I can get Word to run as a different user?
View 4 Replies
Oct 19, 2010
Is there a .Net open source library to convert the word dococument to HTML to display inside the webpage.
I know several tools to convert word docs to html files, but my requirements is to convert the doc(either from the file or just extracted text) to HTML on the fly in the ASP.Net application.
I found the converting-a-word-document-into-usable-html-in-php PHP library do the same thing, is there any similar tool in .net?
View 2 Replies
Mar 8, 2013
How to convert the worddocument into a HTML file using a openoffice (or) OpenXML in C# ....
View 1 Replies
Apr 28, 2010
in my application, when user click on particular link button, MS word has to open how can i write the code for this.
View 3 Replies
Feb 13, 2010
i want to store a word documents (.doc) in the database and i need to provide search over a collection of Word documents and highlight the words too.
I m using VS2005 --> ASP.NET, C#.NET, SQL Server.
View 3 Replies
Mar 26, 2010
I'm looking for a way to export a Word document as a PDF. I would like to do this without the use of a "software printer" (such as CutePDF, etc.) and stick to reference assemblies if at all possible. I'm using Microsoft Office Interop Assemblies to generate a Word Document which I save to a temporary directory. So its not necessary for this solution to interact directly with Microsoft Office, unless it needs to.
View 1 Replies
Mar 16, 2011
One of my sites is on HTTPS and includes a document repository which has a lot of Office documents (.doc, .docx, xls, etc...)
We recently found that these may not be downloaded using IE8. Further research led me to this article.
[URL]
The resolution states to "remove the no-cache header" which is required by design. I found the following article describing how to do so:
how do i remove the security risk, due to cached version of page.
Unfortunately, the methods explained have not worked.
View 1 Replies