91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡(jiǎn)介

c# 操作word強(qiáng)大類(lèi)庫(kù)(牛人版) 一個(gè)很好的操作實(shí)例!

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.Text;
using?Word;
using?System.Data;
using?System.Collections;

namespace?Pixysoft.Office
{
????///?
????///?支持創(chuàng)建、打開(kāi)、保存、關(guān)閉文檔
????///?支持頁(yè)面設(shè)置
????///?支持普通文字輸入設(shè)置
????///?支持表插入
????///?支持BookMark
????///?

????public?class?WordDocuments
????{
????????private?bool?visible?=?false;

????????private?object?oEndOfDoc?=?“\\endofdoc“;?/*?\endofdoc?is?a?predefined?bookmark?*/
????????private?object?oMissing?=?System.Reflection.Missing.Value;

????????Word._Application?oWord;
????????Word._Document?oDoc;

????????Hashtable?templTableHash?=?new?Hashtable();

????????#region?文件操作
????????///?
????????///?新建一個(gè)空文檔
????????///?

????????public?void?CreateDocument()
????????{
????????????CloseDocument();
????????????oWord?=?new?Word.Application();
????????????oWord.Visible?=?visible;
????????????oDoc?=?oWord.Documents.Add(ref?oMissing?ref?oMissing?ref?oMissing?ref?oMissing);
????????}
????????///?
????????///?Creates?the?document?with?template.
????????///?

????????public?void?CreateDocumentWithTemplate(object?path)
????????{
????????????CloseDocument();
????????????oWord?=?new?Word.Application();
????????????oWord.Visible?=?visible;
????????????oDoc?=?oWord.Documents.Add(ref?path?ref?oMissing?ref?oMissing?ref?oMissing);
????????????templTableHash.Clear();
????????????int?i?=?0;
????????????foreach?(Word.Table?table?in?oDoc.Tables)
????????????{
????????????????templTableHash.Add(i?table);
????????????????i++;
????????????}
????????}
????????///?
????????///?打開(kāi)項(xiàng)目
????????///?

????????///?The?path.
????????public?void?OpenDocument(object?path)
????????{
????????????CloseDocument();
????????????oWord?=?new?Word.Application();
????????????oWord.Visible?=?visible;
????????????oDoc?=?oWord.Documents.Open(ref?path
????????????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?ref?oMissing);
????????????templTableHash.Clear();
????????????int?i?=?0;
????????????foreach?(Word.Table?table?in?oDoc.Tables)
????????????{
????????????????templTableHash.Add(i?table);
????????????????i++;
????????????}
????????}
????????///?
????????///?保存當(dāng)前項(xiàng)目
????????///?

????????public?void?SaveDocument()
????????{
????????????if?(oWord?==?null)
????????????????throw?new?Exception(“Create?/?Open?Document?first!“);
????????????if?(oDoc?==?null)
????????????????throw?new?Exception(“Create?/?Open?Document?first!“);
????????????if?(!oDoc.Saved)
????????????????oDoc.Save();
????????}
????????///?
????????///?項(xiàng)目另存為
????????///?

????????public?void?SaveAsDocument(object?path)
????????{
????????????if?(oWord?==?null)
????????????????thro

?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----

?????文件???????6144??2007-05-30?22:43??Pixysoft.Office\bin\Debug\Interop.otkloadr.dll

?????文件??????57344??2007-05-30?22:43??Pixysoft.Office\bin\Debug\Interop.VBIDE.dll

?????文件?????655360??2007-05-30?22:43??Pixysoft.Office\bin\Debug\Interop.Word.dll

?????文件??????32768??2007-06-04?11:34??Pixysoft.Office\bin\Debug\Pixysoft.Office.dll

?????文件??????54784??2007-06-04?11:34??Pixysoft.Office\bin\Debug\Pixysoft.Office.pdb

?????目錄??????????0??2007-06-19?00:08??Pixysoft.Office\bin\Debug

?????目錄??????????0??2007-06-18?20:39??Pixysoft.Office\bin

?????文件???????3641??2007-05-30?22:43??Pixysoft.Office\Documents\ClassDiagram.cd

?????文件????????545??2007-05-30?22:43??Pixysoft.Office\Documents\TestClass.txt

?????目錄??????????0??2007-06-18?20:39??Pixysoft.Office\Documents

?????文件??????32768??2007-06-04?11:34??Pixysoft.Office\obj\Debug\Pixysoft.Office.dll

?????文件??????54784??2007-06-04?11:34??Pixysoft.Office\obj\Debug\Pixysoft.Office.pdb

?????目錄??????????0??2007-06-19?00:08??Pixysoft.Office\obj\Debug\Refactor

?????文件???????6749??2007-06-04?13:15??Pixysoft.Office\obj\Debug\ResolveAssemblyReference.cache

?????目錄??????????0??2007-06-19?00:08??Pixysoft.Office\obj\Debug\TempPE

?????目錄??????????0??2007-06-19?00:08??Pixysoft.Office\obj\Debug

?????文件????????236??2007-06-05?15:49??Pixysoft.Office\obj\Pixysoft.Office.csproj.FileList.txt

?????目錄??????????0??2007-06-18?20:39??Pixysoft.Office\obj

?????文件???????3225??2007-05-30?22:43??Pixysoft.Office\Pixysoft.Office.csproj

?????文件????????455??2007-05-30?22:43??Pixysoft.Office\Pixysoft.Office.csproj.user

?????文件???????1333??2007-05-30?22:43??Pixysoft.Office\Properties\AssemblyInfo.cs

?????目錄??????????0??2007-06-19?00:08??Pixysoft.Office\Properties

?????文件???????1375??2007-05-30?22:43??Pixysoft.Office\WordBookMark\WordBookMarks.cs

?????目錄??????????0??2007-06-19?00:08??Pixysoft.Office\WordBookMark

?????文件??????16027??2007-05-30?22:43??Pixysoft.Office\WordDocuments.cs

?????文件???????6902??2007-05-30?22:43??Pixysoft.Office\Wordparagraph\WordParagraphFormat.cs

?????目錄??????????0??2007-06-19?00:08??Pixysoft.Office\Wordparagraph

?????文件???????8324??2007-05-30?22:43??Pixysoft.Office\WordTable\WordTable.cs

?????文件???????3599??2007-05-30?22:43??Pixysoft.Office\WordTable\WordTableFormat.cs

?????目錄??????????0??2007-06-19?00:08??Pixysoft.Office\WordTable

............此處省略4個(gè)文件信息

評(píng)論

共有 條評(píng)論