Open word doc on webpage (as html)
I have a "help" button on my webpage which opens a word document. But I need to open the contents of this word file on a webpage (like a pop up help page as seen on many websites). How do I achieve this? I'm using C# and asp.net. Please help as I'm quite new to web programming.
Glen LewisPosted Jul 3, 2014, 3:43 AM
I use the same approach, a word dll for C#, but rather then creating a HTML output I create an image output and show the preview of the document in JPEG format.
Niradhip ChakrabortyPosted Jun 30, 2009, 8:40 AM
Niradhip ChakrabortyPosted Jun 30, 2009, 3:44 AM
I asked to take the content from word document and create a html page and as it is the 'help' button I guess the content will be static.
Niradhip ChakrabortyPosted Jun 30, 2009, 2:50 AM
First you create an html page and add your entire word document there (you also can create aspx page). Say your page name is c.
The code snippet of your htm page is as follows:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>My Demo Word pagetitle>
head>
<body>
<form id="frmTermsAndConditions" runat="server" target="TermsAndConditions">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="top"><td valign="top" align="center" class="TextBold" style="FONT-SIZE: 16px"><u>add your word Document here.u>td>tr>
table>
form>
body>
html>
Now you need to call this page as pop up or model window onclick of help button you can use the following javascript function onclick of help button.
Javascript Code:
function OpenWindow()
{
var strUrl=" MyDemo.htm";
var x_left = (screen.width)/2 - 450;
var y_top = (screen.height)/2 - 340;
var WinOpen = window.open(strUrl,"newwin","width=900, height=632, left=" + x_left + ", top=" + y_top + ", help=no, location=no, directories=no, resizable=no, status=no, scrollbars=no, toolbar=no, menubar=no")
}
Subramanyam RompicherlaPosted Jun 30, 2009, 1:31 AM
i hope below link will useful for you
http://www.codeproject.com/KB/aspnet/wordapplication.aspx
http://support.microsoft.com/kb/304662