日期:2014-05-17 浏览次数:20494 次
<%@ WebHandler Language="C#" Class="ajaxWordToHtml" %>
using System;
using System.Web;
using System.Threading;
public class ajaxWordToHtml : IHttpHandler
{
private static object _lock = new object();
string docPath = string.Empty;
string htmlPath = string.Empty;
bool Flang = false;
string Message = string.Empty;
[?STAThread]
private void _Import()
{
object o = Type.Missing;
try
{
Word.Application app = new Word.Application();
app.Visible = false;
object docFile = docPath;
object readOnly = true;
object fileName = htmlPath;
/*office 2003 begin
Word.Document doc = app.Documents.Open(ref docFile, ref o, ref readOnly, ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o);
object format = Word.WdSaveFormat.wdFormatFilteredHTML;
doc.SaveAs(ref fileName, ref format, ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o,