❶ 如何將word,excel,powerpoint等轉換成html或pdf

Office文檔轉換為html網頁文件或者PDF文件主要有以下幾種方法:
PPT文件轉換為PDF格式一般有以下幾種版途徑:
1.Office2007及更高的權版本支持直接將表格文件轉存為html文件或PDF文件,打開文檔,然後點擊另存為,然後從格式列表中選擇網頁格式或者PDF格式即可。
2.使用第三方軟體進行轉換,比如anybizsoft pdf converter。添加幻燈片文件,然後選擇轉換後的格式(pdf),然後點擊轉換即可。
3.使用在線轉換:網路搜索「pdf在線轉換」,然後打開相應的連接,然後上傳文檔,點擊轉換,然後把轉換後的文件下載到本地即可。

❷ word轉html 出現的問題!文檔名或路徑無效!在線等!

嘻嘻。。沒轉過,只試過轉TXT,自己直接改後綴。不懂html怎麼改。

java程序調用 openoffice,將doc文件轉Html文件,但轉換完格式都變成居左邊

1、到官網下載Jacob,
2、將壓縮包解壓後,Jacob.jar添加到Libraries中(先復制到項目目錄中,右鍵單擊jar包選擇BuildPath—>AddtoBuildPath);
3、將Jacob.dll放至當前項目所用到的「jrein」下面(比如Eclipse正在用的Jre路徑是C:Javajdk1.7.0_17jrein)。
Ps:按照上面的步驟配置的,基本沒有問題,但是有些電腦可能還會報錯,比如:java.lang.UnsatisfiedLinkError:nojacobinjava.library.path,這是系統沒有載入到jacob.dll,網上解決方法是將Jacob.dll放至「WINDOWSSYSTEM32」下面。

Java代碼
publicclassJacobUtil{
//8代表word保存成html
publicstaticfinalintWORD_HTML=8;
publicstaticvoidmain(String[]args){
Stringdocfile="C:\Users\無名\Desktop\xxx.doc";
Stringhtmlfile="C:\Users\無名\Desktop\xxx.html";
JacobUtil.wordToHtml(docfile,htmlfile);
}
/**
*WORD轉HTML
*@paramdocfileWORD文件全路徑
*@paramhtmlfile轉換後HTML存放路徑
*/
publicstaticvoidwordToHtml(Stringdocfile,Stringhtmlfile)
{
//啟動word應用程序(MicrosoftOfficeWord2003)
ActiveXComponentapp=newActiveXComponent("Word.Application");
System.out.println("*****正在轉換...*****");
try
{
//設置word應用程序不可見
app.setProperty("Visible",newVariant(false));
//documents表示word程序的所有文檔窗口,(word是多文檔應用程序)
Dispatchdocs=app.getProperty("Documents").toDispatch();
//打開要轉換的word文件
Dispatchdoc=Dispatch.invoke(
docs,
"Open",
Dispatch.Method,
newObject[]{docfile,newVariant(false),
newVariant(true)},newint[1]).toDispatch();
//作為html格式保存到臨時文件
Dispatch.invoke(doc,"SaveAs",Dispatch.Method,newObject[]{
htmlfile,newVariant(WORD_HTML)},newint[1]);
//關閉word文件
Dispatch.call(doc,"Close",newVariant(false));
}catch(Exceptione){
e.printStackTrace();
}finally{
//關閉word應用程序
app.invoke("Quit",newVariant[]{});
}
System.out.println("*****轉換完畢********");
}
}

❹ word文檔轉成html格式不變,我之前是直接另存為.html格式的,但是文字全部是一行顯示,格式不好看,急!

最好截圖看下效果到底是什麼樣的

❺ C# word 轉html 的問題

http://hi..com/%D5%DB%B6%CF%B5%C4%B3%E1%B0%F2_/blog/item/5ce9ca2f99dbcc39359bf7d6.html
你看看這個,我之前做這個是把word直接以「網路文庫」那樣的方式在html頁面顯示,希望對你有幫助

❻ 怎麼樣用ASP代碼編寫將WORD文件轉換成HTML文件

'word文檔轉換成html格式
'**********************************************************
'
'調用方法:doc2htmlc:doc2htmlc:doc2html
'調用方法:doc2html-sc:doc2htmla.docc:doc2html
'
'**********************************************************

DimObjword
DimObjdoc
DimObjfso
DimStrsource
DimStrtarget
DimBbatch

'得到命令行參數,有三種可能的格式:[-s]要進行轉換的源文件目錄或文件轉換成Html文件後保存的目錄
FunctionGetparams()
DimObjarg
IfWscript.Arguments.Count>=2Then
IfWscript.Arguments.Item(0)="-s"OrWscript.Arguments.Item(0)="-S"Then
Strsource=Wscript.Arguments.Item(1)
Strtarget=Wscript.Arguments.Item(2)
Bbatch=False
Else
Strsource=Wscript.Arguments.Item(0)
Strtarget=Wscript.Arguments.Item(1)
Bbatch=True
EndIf
Else
Wscript.Quit(1)
EndIf
EndFunction

FunctionBatchprocessing()
DimObjfolder
DimObjfile
DimLpos
DimStrfilename
Lpos=0
SetObjfolder=Objfso.Getfolder(Strsource)
ForEachObjfileInObjfolder.Files
Lpos=Instr(1,Mid(Objfile.Path,Len(Objfile.Path)-3,4),"Doc",1)
IfLpos>0Then
Strfilename=Objfso.Getbasename(Objfile.Path)
WordinterfaceObjfile.Path,Strfilename
EndIf
Next
EndFunction

❼ 如何將word表格轉換為html語言

可以用剪貼板使用復制和粘貼命令在excel和word的兩個應用程序之間共享數據。由於它們回都支持對象的鏈接與嵌入(ole),答所以也可以用插入命令實現表格的交換。
將word表格插入excel工作表中
(1)啟動word,選中在word中已經編輯好的表格,然後在「編輯」菜單中選「復制」命令。
(2)切換到excel,選中目的地,單擊「編輯」菜單,執行「粘貼」命令。即可完成將word表格插入到當前excel工作表中。
1、在word中選中整個表格,按ctrl
c復制;
2、在excel中單擊a1單元格,ctrl
v粘貼;
3、這時,表格默認也已經加上了邊框,就可以跟excel
中建立的工作表一樣進行計算了
假設你說的第一列是a列,第二列是b,第三列是c,每一
列的第一個數據都是在第一行,則在c1單元輸入:"=a1*b1",回車後再滑鼠拖動c1右下角的小黑點,拖到你想要的那一行為止

❽ c#怎麼將word 轉換成html文件

日常生活中,我們總是在Word中進行文字的編輯,它不僅能夠保存Text文本,還可以保存文本的格式等等。那麼如果我要將一Word文檔上的內容展示在網頁上,該怎麼做呢?這里我提供了一個小工具,你可以將Word轉換為Html,需要顯示的話,可以直接訪問該Html,廢話不多說,下面看代碼。
頁面代碼:

[html] view plain
<span style="font-size:18px;"><div>
<input id="File1" type="file" runat="server"/>
<asp:Button ID="btnConvert" runat="server" Text="轉換" OnClick="btnConvert_Click" />
</div></span>
C#代碼:

[csharp] view plain
<span style="font-size:18px;">using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;

protected void Page_Load(object sender, EventArgs e)
{

}

/// <summary>
/// 將word轉換為Html
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnConvert_Click(object sender, EventArgs e)
{
try
{

//上傳
//uploadWord(File1);
//轉換
wordToHtml(File1);
}
catch (Exception ex)
{
throw ex;
}
finally
{
Response.Write("恭喜,轉換成功!");
}

}

//上傳文件並轉換為html wordToHtml(wordFilePath)
///<summary>
///上傳文件並轉存為html
///</summary>
///<param name="wordFilePath">word文檔在客戶機的位置</param>
///<returns>上傳的html文件的地址</returns>
public string wordToHtml(System.Web.UI.HtmlControls.HtmlInputFile wordFilePath)
{
Microsoft.Office.Interop.Word.ApplicationClass word = new Microsoft.Office.Interop.Word.ApplicationClass();
Type wordType = word.GetType();
Microsoft.Office.Interop.Word.Documents docs = word.Documents;

// 打開文件
Type docsType = docs.GetType();

//應當先把文件上傳至伺服器然後再解析文件為html
string filePath = uploadWord(wordFilePath);

//判斷是否上傳文件成功
if (filePath == "0")
return "0";
//判斷是否為word文件
if (filePath == "1")
return "1";

object fileName = filePath;

Microsoft.Office.Interop.Word.Document doc = (Microsoft.Office.Interop.Word.Document)docsType.InvokeMember("Open",
System.Reflection.BindingFlags.InvokeMethod, null, docs, new Object[] { fileName, true, true });

// 轉換格式,另存為html
Type docType = doc.GetType();

string filename = System.DateTime.Now.Year.ToString() + System.DateTime.Now.Month.ToString() + System.DateTime.Now.Day.ToString() +
System.DateTime.Now.Hour.ToString() + System.DateTime.Now.Minute.ToString() + System.DateTime.Now.Second.ToString();

// 判斷指定目錄下是否存在文件夾,如果不存在,則創建
if (!Directory.Exists(Server.MapPath("~\\html")))
{
// 創建up文件夾
Directory.CreateDirectory(Server.MapPath("~\\html"));
}

//被轉換的html文檔保存的位置
string ConfigPath = HttpContext.Current.Server.MapPath("html/" + filename + ".html");
object saveFileName = ConfigPath;

/*下面是Microsoft Word 9 Object Library的寫法,如果是10,可能寫成:
* docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod,
* null, doc, new object[]{saveFileName, Word.WdSaveFormat.wdFormatFilteredHTML});
* 其它格式:
* wdFormatHTML
* wdFormatDocument
* wdFormatDOSText
* wdFormatDOSTextLineBreaks
* wdFormatEncodedText
* wdFormatRTF
* wdFormatTemplate
* wdFormatText
* wdFormatTextLineBreaks
* wdFormatUnicodeText
*/
docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod,
null, doc, new object[] { saveFileName, Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatFilteredHTML });

//關閉文檔
docType.InvokeMember("Close", System.Reflection.BindingFlags.InvokeMethod,
null, doc, new object[] { null, null, null });

// 退出 Word
wordType.InvokeMember("Quit", System.Reflection.BindingFlags.InvokeMethod, null, word, null);
//轉到新生成的頁面
return ("/" + filename + ".html");

}

public string uploadWord(System.Web.UI.HtmlControls.HtmlInputFile uploadFiles)
{
if (uploadFiles.PostedFile != null)
{
string fileName = uploadFiles.PostedFile.FileName;

int extendNameIndex = fileName.LastIndexOf(".");
string extendName = fileName.Substring(extendNameIndex);
string newName = "";
try
{
//驗證是否為word格式
if (extendName == ".doc" || extendName == ".docx")
{

DateTime now = DateTime.Now;
newName = now.DayOfYear.ToString() + uploadFiles.PostedFile.ContentLength.ToString();

// 判斷指定目錄下是否存在文件夾,如果不存在,則創建
if (!Directory.Exists(Server.MapPath("~\\wordTmp")))
{
// 創建up文件夾
Directory.CreateDirectory(Server.MapPath("~\\wordTmp"));
}

//上傳路徑 指當前上傳頁面的同一級的目錄下面的wordTmp路徑
uploadFiles.PostedFile.SaveAs(System.Web.HttpContext.Current.Server.MapPath("wordTmp/" + newName + extendName));
}
else
{
return "1";
}
}
catch
{
return "0";
}
//return "http://" + HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.ApplicationPath + "/wordTmp/" + newName + extendName;
return System.Web.HttpContext.Current.Server.MapPath("wordTmp/" + newName + extendName);
}
else
{
return "0";
}
}</span>

❾ c#如何把word文檔轉成html

日常生活中,我們總是在Word中進行文字的編輯,它不僅能夠保存Text文本,還可以保存文本的格式等等。那麼如果我要將一Word文檔上的內容展示在網頁上,該怎麼做呢?這里我提供了一個小工具,你可以將Word轉換為Html,需要顯示的話,可以直接訪問該Html,廢話不多說,下面看代碼。
頁面代碼:

[html] view plain
<span style="font-size:18px;"><div>
<input id="File1" type="file" runat="server"/>
<asp:Button ID="btnConvert" runat="server" Text="轉換" OnClick="btnConvert_Click" />
</div></span>
C#代碼:

[csharp] view plain
<span style="font-size:18px;">using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;

protected void Page_Load(object sender, EventArgs e)
{

}

/// <summary>
/// 將word轉換為Html
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnConvert_Click(object sender, EventArgs e)
{
try
{

//上傳
//uploadWord(File1);
//轉換
wordToHtml(File1);
}
catch (Exception ex)
{
throw ex;
}
finally
{
Response.Write("恭喜,轉換成功!");
}

}

//上傳文件並轉換為html wordToHtml(wordFilePath)
///<summary>
///上傳文件並轉存為html
///</summary>
///<param name="wordFilePath">word文檔在客戶機的位置</param>
///<returns>上傳的html文件的地址</returns>
public string wordToHtml(System.Web.UI.HtmlControls.HtmlInputFile wordFilePath)
{
Microsoft.Office.Interop.Word.ApplicationClass word = new Microsoft.Office.Interop.Word.ApplicationClass();
Type wordType = word.GetType();
Microsoft.Office.Interop.Word.Documents docs = word.Documents;

// 打開文件
Type docsType = docs.GetType();

//應當先把文件上傳至伺服器然後再解析文件為html
string filePath = uploadWord(wordFilePath);

//判斷是否上傳文件成功
if (filePath == "0")
return "0";
//判斷是否為word文件
if (filePath == "1")
return "1";

object fileName = filePath;

Microsoft.Office.Interop.Word.Document doc = (Microsoft.Office.Interop.Word.Document)docsType.InvokeMember("Open",
System.Reflection.BindingFlags.InvokeMethod, null, docs, new Object[] { fileName, true, true });

// 轉換格式,另存為html
Type docType = doc.GetType();

string filename = System.DateTime.Now.Year.ToString() + System.DateTime.Now.Month.ToString() + System.DateTime.Now.Day.ToString() +
System.DateTime.Now.Hour.ToString() + System.DateTime.Now.Minute.ToString() + System.DateTime.Now.Second.ToString();

// 判斷指定目錄下是否存在文件夾,如果不存在,則創建
if (!Directory.Exists(Server.MapPath("~\\html")))
{
// 創建up文件夾
Directory.CreateDirectory(Server.MapPath("~\\html"));
}

//被轉換的html文檔保存的位置
string ConfigPath = HttpContext.Current.Server.MapPath("html/" + filename + ".html");
object saveFileName = ConfigPath;

/*下面是Microsoft Word 9 Object Library的寫法,如果是10,可能寫成:
* docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod,
* null, doc, new object[]{saveFileName, Word.WdSaveFormat.wdFormatFilteredHTML});
* 其它格式:
* wdFormatHTML
* wdFormatDocument
* wdFormatDOSText
* wdFormatDOSTextLineBreaks
* wdFormatEncodedText
* wdFormatRTF
* wdFormatTemplate
* wdFormatText
* wdFormatTextLineBreaks
* wdFormatUnicodeText
*/
docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod,
null, doc, new object[] { saveFileName, Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatFilteredHTML });

//關閉文檔
docType.InvokeMember("Close", System.Reflection.BindingFlags.InvokeMethod,
null, doc, new object[] { null, null, null });

// 退出 Word
wordType.InvokeMember("Quit", System.Reflection.BindingFlags.InvokeMethod, null, word, null);
//轉到新生成的頁面
return ("/" + filename + ".html");

}

public string uploadWord(System.Web.UI.HtmlControls.HtmlInputFile uploadFiles)
{
if (uploadFiles.PostedFile != null)
{
string fileName = uploadFiles.PostedFile.FileName;

int extendNameIndex = fileName.LastIndexOf(".");
string extendName = fileName.Substring(extendNameIndex);
string newName = "";
try
{
//驗證是否為word格式
if (extendName == ".doc" || extendName == ".docx")
{

DateTime now = DateTime.Now;
newName = now.DayOfYear.ToString() + uploadFiles.PostedFile.ContentLength.ToString();

// 判斷指定目錄下是否存在文件夾,如果不存在,則創建
if (!Directory.Exists(Server.MapPath("~\\wordTmp")))
{
// 創建up文件夾
Directory.CreateDirectory(Server.MapPath("~\\wordTmp"));
}

//上傳路徑 指當前上傳頁面的同一級的目錄下面的wordTmp路徑
uploadFiles.PostedFile.SaveAs(System.Web.HttpContext.Current.Server.MapPath("wordTmp/" + newName + extendName));
}
else
{
return "1";
}
}
catch
{
return "0";
}
//return "http://" + HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.ApplicationPath + "/wordTmp/" + newName + extendName;
return System.Web.HttpContext.Current.Server.MapPath("wordTmp/" + newName + extendName);
}
else
{
return "0";
}
}</span>