C#操作Word表格的彪悍实例

开发 后端
C#操作Word表格的彪悍实例向你介绍了一个使用的C#操作Word表格的操作代码,希望对你学习C#操作Word表格的开发有所帮助。

最近由于工作需要,做了一些关于C#操作Word表格文档方面的工作.主要是是C#操作Word表格的操作,以下是部分代码,关于操作不规则表格的.那么让我们来看看具体的实施吧:

using System;  
using System.Collections;  
using System.ComponentModel;  
using System.Data;  
using System.Drawing;  
using System.Web;  
using System.Web.SessionState;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using System.Web.UI.HtmlControls;  
using System.Configuration;  
using System.IO;  
 
using System.Reflection;  
using System.Runtime.InteropServices ;  
using System.Threading;  
 //C#操作Word表格
public void MakeMyTable(DataTable DT,string strFilePath)  
  {  
     
   string strEnd   = this.txtEnd.Text.Trim().ToString();  
   string strStart = this.txtStart.Text.Trim().ToString();  
//生成文档分页中的起始和终止页  
   string strSign = "("+strStart + "-" + strEnd + ")";  
 
   //杀掉所有word进程以保证速度  
   //KillWordProcess();  
 
   object Nothing = System.Reflection.Missing.Value;   
   object missing = System.Reflection.Missing.Value;   
   object filename= strFilePath;    
 
   Word.Application wordApp=new Word.ApplicationClass();   
   Word.Document wordDoc=wordApp.Documents.Add(  
ref Nothing,ref Nothing,ref Nothing,ref Nothing);   
 //C#操作Word表格
   try 
   {  
    //生成过程中屏蔽返回按扭,不允许中途停止  
    Button2.Enabled = false;  
    #region 生成文档  
    //设置文档宽度  
    wordApp.Selection.PageSetup.LeftMargin  =  
 wordApp.CentimetersToPoints(float.Parse("2"));  
    wordApp.ActiveWindow.ActivePane.HorizontalPercentScrolled = 11 ;  
    wordApp.Selection.PageSetup.RightMargin =  
 wordApp.CentimetersToPoints(float.Parse("2"));  
 
    Object start = Type.Missing;  
    Object end = Type.Missing;  
    Object unit = Type.Missing;  
    Object count = Type.Missing;  
    wordDoc.Range(ref start, ref end).  
Delete(ref unit, ref count);  
 
 //C#操作Word表格
    object rng = Type.Missing;  
    string strInfo = this.txtNameCh.  
Text.ToString()+"明细表"+strSign+"\r\n";  
    start = 0;  
    end = 0;  
    wordDoc.Range(ref start, ref end).  
InsertBefore(strInfo);  
    wordDoc.Range(ref start, ref end).  
Font.Name = "Verdana";   
    wordDoc.Range(ref start, ref end).  
Font.Size = 20;  
    wordDoc.Range(ref start, ref end).  
ParagraphFormat.Alignment = Word.WdParagraphAlignment.  
wdAlignParagraphCenter;  
 
    start = 8;  
    end = strInfo.Length;  
    wordDoc.Range(ref start, ref end).  
InsertParagraphAfter();//插入回车  
 
    if(DT.Rows.Count>0)  
    {  
//C#操作Word表格之存在数据项  
//添加一个表格  
object missingValue = Type.Missing;   
object location = strInfo.Length;   
//注:若location超过已有字符的长度将会出错。一定要比"明细表"串多一个字符  
Word.Range rng2 = wordDoc.Range(ref location, ref location);  
 
wordDoc.Tables.Add(rng2, 13, 6, ref missingValue, ref missingValue);   
wordDoc.Tables.Item(1).Rows.HeightRule =   
Word.WdRowHeightRule.wdRowHeightAtLeast;  
wordDoc.Tables.Item(1).Rows.Height = wordApp.  
CentimetersToPoints(float.Parse("0.8"));  
wordDoc.Tables.Item(1).Range.Font.Size = 10;  
wordDoc.Tables.Item(1).Range.Font.Name = "宋体";  
wordDoc.Tables.Item(1).Range.ParagraphFormat.Alignment =  
 Word.WdParagraphAlignment.wdAlignParagraphCenter;  
wordDoc.Tables.Item(1).Range.Cells.VerticalAlignment =  
 Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter;  
//C#操作Word表格之设置表格样式  
wordDoc.Tables.Item(1).Borders.  
Item(Word.WdBorderType.wdBorderLeft).LineStyle =  
 Word.WdLineStyle.wdLineStyleSingle;  
wordDoc.Tables.Item(1).Borders.  
Item(Word.WdBorderType.wdBorderLeft).LineWidth =  
 Word.WdLineWidth.wdLineWidth050pt;  
wordDoc.Tables.Item(1).Borders.  
Item(Word.WdBorderType.wdBorderLeft).Color =   
Word.WdColor.wdColorAutomatic;  
 
wordDoc.Tables.Item(1).Borders.  
Item(Word.WdBorderType.wdBorderTop).LineStyle =   
Word.WdLineStyle.wdLineStyleSingle;  
wordDoc.Tables.Item(1).Borders.  
Item(Word.WdBorderType.wdBorderTop).LineWidth =   
Word.WdLineWidth.wdLineWidth050pt;  
wordDoc.Tables.Item(1).Borders.  
Item(Word.WdBorderType.wdBorderTop).Color =  
 Word.WdColor.wdColorAutomatic;  
 
wordDoc.Tables.Item(1).Borders.  
Item(Word.WdBorderType.wdBorderBottom).LineStyle =  
 Word.WdLineStyle.wdLineStyleSingle;  
wordDoc.Tables.Item(1).Borders.  
Item(Word.WdBorderType.wdBorderBottom).LineWidth =  
 Word.WdLineWidth.wdLineWidth050pt;  
wordDoc.Tables.Item(1).Borders.  
Item(Word.WdBorderType.wdBorderBottom).Color =  
 Word.WdColor.wdColorAutomatic;  
 
wordDoc.Tables.Item(1).Borders.  
Item(Word.WdBorderType.wdBorderHorizontal).LineStyle =   
Word.WdLineStyle.wdLineStyleSingle;  
wordDoc.Tables.Item(1).Borders.  
Item(Word.WdBorderType.wdBorderHorizontal).LineWidth =   
Word.WdLineWidth.wdLineWidth050pt;  
wordDoc.Tables.Item(1).Borders.  
Item(Word.WdBorderType.wdBorderHorizontal).Color =   
Word.WdColor.wdColorAutomatic;  
 
wordDoc.Tables.Item(1).Borders.  
Item(Word.WdBorderType.wdBorderVertical).LineStyle =   
Word.WdLineStyle.wdLineStyleSingle;  
wordDoc.Tables.Item(1).Borders.  
Item(Word.WdBorderType.wdBorderVertical).LineWidth =   
Word.WdLineWidth.wdLineWidth050pt;  
wordDoc.Tables.Item(1).Borders.  
Item(Word.WdBorderType.wdBorderVertical).Color =   
Word.WdColor.wdColorAutomatic;  
 
wordDoc.Tables.Item(1).Borders.  
Item(Word.WdBorderType.wdBorderRight).LineStyle =   
Word.WdLineStyle.wdLineStyleSingle;  
wordDoc.Tables.Item(1).Borders.  
Item(Word.WdBorderType.wdBorderRight).LineWidth =   
Word.WdLineWidth.wdLineWidth050pt;  
wordDoc.Tables.Item(1).Borders.  
Item(Word.WdBorderType.wdBorderRight).Color =   
Word.WdColor.wdColorAutomatic;  
 //C#操作Word表格
//wordDoc.Tables.Item(k).Borders.  
Item(Word.WdBorderType.wdBorderDiagonalDown).  
LineStyle = Word.WdLineStyle.wdLineStyleSingle;  
//wordDoc.Tables.Item(k).Borders.  
Item(Word.WdBorderType.wdBorderDiagonalDown).  
LineWidth = Word.WdLineWidth.wdLineWidth050pt;  
//wordDoc.Tables.Item(k).Borders.  
Item(Word.WdBorderType.wdBorderDiagonalDown).  
Color = Word.WdColor.wdColorAutomatic;  
//第一行显示  
wordDoc.Tables.Item(1).Cell(1,2).  
Merge(wordDoc.Tables.Item(1).Cell(1,3));  
wordDoc.Tables.Item(1).Cell(1,4).  
Merge(wordDoc.Tables.Item(1).Cell(1,5));  
 
//第二行显示  
wordDoc.Tables.Item(1).Cell(2,5).  
Merge(wordDoc.Tables.Item(1).Cell(2,6));  
wordDoc.Tables.Item(1).Cell(1,4).  
Merge(wordDoc.Tables.Item(1).Cell(2,5));  
 
#region 插入数据行  
wordDoc.Tables.Item(1).Cell(1, 1).Range.Text = "cell11";   
//wordDoc.Tables.Item(k).Cell(1, 2).Range.Text =  
 DT.Rows[i]["cell11"].ToString();  
 
////******************  
wordDoc.Tables.Item(1).Cell(1, 3).Range.Text = "cell13";   
//wordDoc.Tables.Item(k).Cell(1, 4).Range.Text =  
 DT.Rows[i]["cell13"].ToString();  
 
////******************  
wordDoc.Tables.Item(1).Cell(2, 1).Range.Text = "cell21";   
//wordDoc.Tables.Item(k).Cell(2, 2).Range.Text =   
DT.Rows[i]["cell21"].ToString();  
 
////******************  
wordDoc.Tables.Item(1).Cell(2, 3).Range.Text = "cell23";   
//wordDoc.Tables.Item(k).Cell(2, 4).Range.Text =  
 DT.Rows[i]["cell23"].ToString();  
 
#endregion  
 //C#操作Word表格
#region 第三行显示  
wordDoc.Tables.Item(1).Cell(3,2).  
Merge(wordDoc.Tables.Item(1).Cell(3,3));  
wordDoc.Tables.Item(1).Cell(3,2).  
Merge(wordDoc.Tables.Item(1).Cell(3,3));  
 
////******************  
wordDoc.Tables.Item(1).Cell(3, 1).Range.Text = "cell31";   
 
////******************  
wordDoc.Tables.Item(1).Cell(3, 3).Range.Text = "cell33" 
 
#endregion  
 
#region 第五行显示  
wordDoc.Tables.Item(1).Cell(5,2).  
Merge(wordDoc.Tables.Item(1).Cell(5,3));  
wordDoc.Tables.Item(1).Cell(5,2).  
Merge(wordDoc.Tables.Item(1).Cell(5,3));  
wordDoc.Tables.Item(1).Cell(5,2).  
Merge(wordDoc.Tables.Item(1).Cell(5,3));  
wordDoc.Tables.Item(1).Cell(5,2).  
Merge(wordDoc.Tables.Item(1).Cell(5,3));  
#endregion  
 
#region  第四行显示  
 
////******************  
wordDoc.Tables.Item(1).Cell(4, 1).Range.Text = "cell41";  
 
////******************  
wordDoc.Tables.Item(1).Cell(4, 3).Range.Text = "cell43";   
 
////******************  
wordDoc.Tables.Item(1).Cell(4, 5).Range.Text = "cell45" 
 
#endregion  
 //C#操作Word表格
#region 第六行显示  
wordDoc.Tables.Item(1).Cell(6,2).  
Merge(wordDoc.Tables.Item(1).Cell(6,3));  
wordDoc.Tables.Item(1).Cell(6,2).  
Merge(wordDoc.Tables.Item(1).Cell(6,3));  
wordDoc.Tables.Item(1).Cell(6,2).  
Merge(wordDoc.Tables.Item(1).Cell(6,3));  
wordDoc.Tables.Item(1).Cell(6,2).  
Merge(wordDoc.Tables.Item(1).Cell(6,3));  
 
 
////******************  
wordDoc.Tables.Item(1).Cell(5, 1).  
Range.Text = "cell51";  
 
wordDoc.Tables.Item(1).Cell(5, 2).  
Range.ParagraphFormat.Alignment =   
Word.WdParagraphAlignment.wdAlignParagraphLeft;  
 
   
 
////******************  
wordDoc.Tables.Item(1).Cell(6, 1).Range.Text = "cdll61";  
 
wordDoc.Tables.Item(1).Cell(6, 2).  
Range.ParagraphFormat.Alignment =   
Word.WdParagraphAlignment.wdAlignParagraphLeft;  
#endregion  
 
 
#region 第七行显示  
wordDoc.Tables.Item(1).Cell(7,2).  
Merge(wordDoc.Tables.Item(1).Cell(7,3));  
wordDoc.Tables.Item(1).Cell(7,2).  
Merge(wordDoc.Tables.Item(1).Cell(7,3));  
wordDoc.Tables.Item(1).Cell(7,2).  
Merge(wordDoc.Tables.Item(1).Cell(7,3));  
wordDoc.Tables.Item(1).Cell(7,2).  
Merge(wordDoc.Tables.Item(1).Cell(7,3));  
 
////******************  
wordDoc.Tables.Item(1).Cell(7, 1).Range.Text = "cell71";  
 
wordDoc.Tables.Item(1).Cell(7, 2).Range.  
ParagraphFormat.Alignment = Word.WdParagraphAlignment.  
wdAlignParagraphLeft;  
#endregion  
 
 
#region 第八行显示  
wordDoc.Tables.Item(1).Cell(8,1).  
Merge(wordDoc.Tables.Item(1).Cell(8,2));  
wordDoc.Tables.Item(1).Cell(8,2).  
Merge(wordDoc.Tables.Item(1).Cell(8,3));  
wordDoc.Tables.Item(1).Cell(8,2).  
Merge(wordDoc.Tables.Item(1).Cell(8,3));  
wordDoc.Tables.Item(1).Cell(8,2).  
Merge(wordDoc.Tables.Item(1).Cell(8,3));  
 
 
#endregion  
 
 
#region 第九行显示  
wordDoc.Tables.Item(1).Cell(9,1).Merge(wordDoc.Tables.Item(1).Cell(9,2));  
wordDoc.Tables.Item(1).Cell(9,3).Merge(wordDoc.Tables.Item(1).Cell(9,4));  
 
////******************  
wordDoc.Tables.Item(1).Cell(9, 1).Range.Text = "cell91";  
//wordDoc.Tables.Item(k).Cell(9, 2).Range.Text =   
 (DT.Rows[i]["cell91"].ToString()=="1"?"有":"无");  
 
   //C#操作Word表格
 
 
////******************  
wordDoc.Tables.Item(1).Cell(9, 3).Range.Text = "cell93";  
     
#endregion  
 
 
#region 第十行显示  
wordDoc.Tables.Item(1).Cell(10,1).Merge(wordDoc.Tables.Item(1).Cell(10,2));  
wordDoc.Tables.Item(1).Cell(10,3).Merge(wordDoc.Tables.Item(1).Cell(10,4));  
////******************  
wordDoc.Tables.Item(1).Cell(10, 1).Range.Text = "cell101";  
 
 
   
 
////******************  
wordDoc.Tables.Item(1).Cell(10, 3).Range.Text = "cdll103";  
//wordDoc.Tables.Item(k).Cell(10, 4).Range.Text =  
 (DT.Rows[i]["Label"].ToString()=="1"?"有":"无");  
#endregion  
 
 
#region 第十一行显示  
wordDoc.Tables.Item(1).Cell(11,1).  
Merge(wordDoc.Tables.Item(1).Cell(11,2));  
wordDoc.Tables.Item(1).Cell(11,3).  
Merge(wordDoc.Tables.Item(1).Cell(11,4));  
////******************  
wordDoc.Tables.Item(1).Cell(11, 1).Range.Text = "cell111";  
 
 
 
////******************  
wordDoc.Tables.Item(1).Cell(11, 3).Range.Text = "cell113";  
     
#endregion  
 
 
#region 第十二行显示  
wordDoc.Tables.Item(1).Cell(12,1).  
Merge(wordDoc.Tables.Item(1).Cell(12,2));  
wordDoc.Tables.Item(1).Cell(12,3).  
Merge(wordDoc.Tables.Item(1).Cell(12,4));  
////******************  
wordDoc.Tables.Item(1).Cell(12, 1).Range.Text = "cell121";  
 
 
////******************  
wordDoc.Tables.Item(1).Cell(12, 3).Range.Text = "cell123";  
 
#endregion  
 
 
#region 第十三行显示  
wordDoc.Tables.Item(1).Cell(13,1).  
Merge(wordDoc.Tables.Item(1).Cell(13,2));  
wordDoc.Tables.Item(1).Cell(13,3).  
Merge(wordDoc.Tables.Item(1).Cell(13,4));  
 
////******************  
wordDoc.Tables.Item(1).Cell(13, 1).Range.Text = "cell131";  
 //C#操作Word表格
 
////******************  
wordDoc.Tables.Item(1).Cell(13, 3).Range.Text = "cell133";  
    
#endregion  
 
wordDoc.Tables.Item(1).Select();  
wordApp.Application.Selection.Cut();  
 
//重新成声所有表  
 
     
 
 
for(int i = 0; i<=DT.Rows.Count-1;i++)  
{  
 wordApp.Application.Selection.Paste();  
 int k = i+1;  
 #region    更新数据  
 
 
 #region 插入数据行  
   
 wordDoc.Tables.Item(k).Cell(1, 2).Range.Text =   
DT.Rows[i]["1"].ToString();  
 
   
 
 ////******************  
   
 wordDoc.Tables.Item(k).Cell(1, 4).Range.Text =   
DT.Rows[i]["2"].ToString();  
 
   
 
 ////******************  
    
 wordDoc.Tables.Item(k).Cell(2, 2).Range.Text =   
DT.Rows[i]["3"].ToString();  
 
 
 ////******************  
   
 wordDoc.Tables.Item(k).Cell(2, 4).Range.Text =   
DT.Rows[i]["4"].ToString();  
 
 #endregion  
 //C#操作Word表格
 
 #region 第三行显示  
 ////******************  
   
 wordDoc.Tables.Item(k).Cell(3, 2).Range.Text =  
 DT.Rows[i]["5"].ToString();  
 ////******************  
   
 wordDoc.Tables.Item(k).Cell(3, 4).Range.Text =   
DT.Rows[i]["6"].ToString();  
 
 #endregion  
 
 
 #region 第五行显示  
 ////******************  
   
 wordDoc.Tables.Item(k).Cell(5, 2).Range.Text = DT.Rows[i]["7"].ToString();  
 wordDoc.Tables.Item(k).Cell(5, 2).Range.ParagraphFormat  
.Alignment = Word.WdParagraphAlignment.wdAlignParagraphLeft;  
 #endregion  
 
 #region  第四行显示  
 
 ////******************  
   
 wordDoc.Tables.Item(k).Cell(4, 2).Range.Text = DT.Rows[i]["8"].ToString();  
 
   
 
 ////******************  
   
 wordDoc.Tables.Item(k).Cell(4, 4).Range.Text = DT.Rows[i]["9"].ToString();  
 
   
 
 ////******************  
   
 wordDoc.Tables.Item(k).Cell(4, 6).Range.Text = DT.Rows[i]["0"].ToString();  
 #endregion  
 
 
 #region 第六行显示  
 ////******************  
   
 wordDoc.Tables.Item(k).Cell(6, 2).Range.Text =   
DT.Rows[i]["11"].ToString();  
 wordDoc.Tables.Item(k).Cell(6, 2).Range.ParagraphFormat  
.Alignment = Word.WdParagraphAlignment.wdAlignParagraphLeft;  
 #endregion  
 
 //C#操作Word表格
 #region 第七行显示  
 ////******************  
   
 wordDoc.Tables.Item(k).Cell(7, 2).Range.  
Text = DT.Rows[i]["12"].ToString();  
 wordDoc.Tables.Item(k).Cell(7, 2).Range.  
ParagraphFormat.Alignment = Word.WdParagraphAlignment.  
wdAlignParagraphLeft;  
 #endregion  
 
 
 #region 第八行显示  
 ////******************  
   
 string strTechlevel = DT.Rows[i]["Level"].ToString();  
 string returnTechlevel = "";  
 switch(strTechlevel)  
 {  
  case "1":  
   returnTechlevel = "Level1";  
   break;  
  case "2":  
   returnTechlevel = "Level2";  
   break;  
  case "3":  
   returnTechlevel = "Level3";  
   break;  
  case "0":  
   returnTechlevel = "Level4";  
   break;  
  default:  
   returnTechlevel = "Level5";  
   break;  
 }  
 wordDoc.Tables.Item(k).Cell(8, 2).  
Range.Text = returnTechlevel;  
 
 #endregion  
 
 
 #region 第九行显示  
 ////******************  
   
 wordDoc.Tables.Item(k).Cell(9, 2).Range.Text =   
 (DT.Rows[i]["14"].ToString()=="1"?"有":"无");  
 
 //C#操作Word表格  
 
 
 ////******************  
   
 wordDoc.Tables.Item(k).Cell(9, 4).Range.Text =   
(DT.Rows[i]["15"].ToString()=="1"?"是":"否");  
 #endregion  
 
 
 #region 第十行显示  
 ////******************  
   
 wordDoc.Tables.Item(k).Cell(10, 2).Range.Text =    
(DT.Rows[i]["16"].ToString()=="1"?"有":"无");  
 
   
 
 ////******************  
   
 wordDoc.Tables.Item(k).Cell(10, 4).Range.Text =   
(DT.Rows[i]["17"].ToString()=="1"?"有":"无");  
 #endregion  
 
 
 #region 第十一行显示  
 
 ////******************  
   
 wordDoc.Tables.Item(k).Cell(11, 2).Range.Text =    
(DT.Rows[i]["18"].ToString()=="1"?"是":"否");  
 
 
 ////******************  
   
 wordDoc.Tables.Item(k).Cell(11, 4).Range.Text =   
(DT.Rows[i]["19"].ToString()=="1"?"是":"否");  
 #endregion  
 
 
 #region 第十二行显示  
 ////******************  
   
 wordDoc.Tables.Item(k).Cell(12, 2).Range.Text =    
(DT.Rows[i]["20"].ToString()=="1"?"是":"否");  
 
 ////******************  
   
 wordDoc.Tables.Item(k).Cell(12, 4).Range.Text =    
(DT.Rows[i]["21"].ToString()=="1"?"是":"否");  
 #endregion  
 
 
 #region 第十三行显示  
 
   
 wordDoc.Tables.Item(k).Cell(13, 2).Range.Text =    
(DT.Rows[i]["22"].ToString()=="1"?"是":"否");  
 
 ////******************  
   
 wordDoc.Tables.Item(k).Cell(13, 4).Range.Text =    
(DT.Rows[i]["23"].ToString()=="1"?"是":"否");  
 #endregion  
 
 #endregion  
 
 //插入分页  
 if(i!=DT.Rows.Count-1)  
 {  
  object mymissing = System.Reflection.Missing.Value;  
  object myunit = Word.WdUnits.wdStory;  
  wordApp.Selection.EndKey(ref myunit,ref mymissing);  
 
  object pBreak= (int)Word.WdBreakType.wdPageBreak;  
  wordApp.Selection.InsertBreak( ref pBreak );  
 }  
}  
      
 
wordDoc.SaveAs(ref filename,   
ref missing,ref missing, ref missing,  
ref missing,ref missing,ref missing,  
ref missing,ref missing,ref missing, ref missing);  
     
     //C#操作Word表格
wordDoc.Close(ref Nothing, ref Nothing, ref Nothing);   
wordApp.Quit(ref Nothing, ref Nothing, ref Nothing);   
 
if ( wordDoc != null )  
{  
 System.Runtime.InteropServices.Marshal.  
ReleaseComObject(wordDoc);  
 wordDoc = null;  
}  
if ( wordApp != null )  
{  
 System.Runtime.InteropServices.Marshal.  
ReleaseComObject(wordApp);  
 wordApp = null;  
}  
GC.Collect();  
//KillWordProcess();  
string strUrl = "MakeWordFile.aspx?username=" 
+Request.QueryString["username"].ToString();  
utility.ShowPopMessage("文档生成完毕!",strUrl);  
    }  
    else 
    {  
utility.ShowPopMessage("无任何数据!");  
    }  
    #endregion  
 
     
 
   }  
   catch 
   {  
    wordDoc.Close(ref Nothing, ref Nothing, ref Nothing);   
    wordApp.Quit(ref Nothing, ref Nothing, ref Nothing);   
    if ( wordDoc != null )  
    {  
System.Runtime.InteropServices.Marshal.  
ReleaseComObject(wordDoc);  
wordDoc = null;  
    }  
    if ( wordApp != null )  
    {  
System.Runtime.InteropServices.Marshal.  
ReleaseComObject(wordApp);  
wordApp = null;  
    }  
    GC.Collect();  
    utility.ShowPopMessage("文档生成失败!");  
 
   }  
  } 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.
  • 87.
  • 88.
  • 89.
  • 90.
  • 91.
  • 92.
  • 93.
  • 94.
  • 95.
  • 96.
  • 97.
  • 98.
  • 99.
  • 100.
  • 101.
  • 102.
  • 103.
  • 104.
  • 105.
  • 106.
  • 107.
  • 108.
  • 109.
  • 110.
  • 111.
  • 112.
  • 113.
  • 114.
  • 115.
  • 116.
  • 117.
  • 118.
  • 119.
  • 120.
  • 121.
  • 122.
  • 123.
  • 124.
  • 125.
  • 126.
  • 127.
  • 128.
  • 129.
  • 130.
  • 131.
  • 132.
  • 133.
  • 134.
  • 135.
  • 136.
  • 137.
  • 138.
  • 139.
  • 140.
  • 141.
  • 142.
  • 143.
  • 144.
  • 145.
  • 146.
  • 147.
  • 148.
  • 149.
  • 150.
  • 151.
  • 152.
  • 153.
  • 154.
  • 155.
  • 156.
  • 157.
  • 158.
  • 159.
  • 160.
  • 161.
  • 162.
  • 163.
  • 164.
  • 165.
  • 166.
  • 167.
  • 168.
  • 169.
  • 170.
  • 171.
  • 172.
  • 173.
  • 174.
  • 175.
  • 176.
  • 177.
  • 178.
  • 179.
  • 180.
  • 181.
  • 182.
  • 183.
  • 184.
  • 185.
  • 186.
  • 187.
  • 188.
  • 189.
  • 190.
  • 191.
  • 192.
  • 193.
  • 194.
  • 195.
  • 196.
  • 197.
  • 198.
  • 199.
  • 200.
  • 201.
  • 202.
  • 203.
  • 204.
  • 205.
  • 206.
  • 207.
  • 208.
  • 209.
  • 210.
  • 211.
  • 212.
  • 213.
  • 214.
  • 215.
  • 216.
  • 217.
  • 218.
  • 219.
  • 220.
  • 221.
  • 222.
  • 223.
  • 224.
  • 225.
  • 226.
  • 227.
  • 228.
  • 229.
  • 230.
  • 231.
  • 232.
  • 233.
  • 234.
  • 235.
  • 236.
  • 237.
  • 238.
  • 239.
  • 240.
  • 241.
  • 242.
  • 243.
  • 244.
  • 245.
  • 246.
  • 247.
  • 248.
  • 249.
  • 250.
  • 251.
  • 252.
  • 253.
  • 254.
  • 255.
  • 256.
  • 257.
  • 258.
  • 259.
  • 260.
  • 261.
  • 262.
  • 263.
  • 264.
  • 265.
  • 266.
  • 267.
  • 268.
  • 269.
  • 270.
  • 271.
  • 272.
  • 273.
  • 274.
  • 275.
  • 276.
  • 277.
  • 278.
  • 279.
  • 280.
  • 281.
  • 282.
  • 283.
  • 284.
  • 285.
  • 286.
  • 287.
  • 288.
  • 289.
  • 290.
  • 291.
  • 292.
  • 293.
  • 294.
  • 295.
  • 296.
  • 297.
  • 298.
  • 299.
  • 300.
  • 301.
  • 302.
  • 303.
  • 304.
  • 305.
  • 306.
  • 307.
  • 308.
  • 309.
  • 310.
  • 311.
  • 312.
  • 313.
  • 314.
  • 315.
  • 316.
  • 317.
  • 318.
  • 319.
  • 320.
  • 321.
  • 322.
  • 323.
  • 324.
  • 325.
  • 326.
  • 327.
  • 328.
  • 329.
  • 330.
  • 331.
  • 332.
  • 333.
  • 334.
  • 335.
  • 336.
  • 337.
  • 338.
  • 339.
  • 340.
  • 341.
  • 342.
  • 343.
  • 344.
  • 345.
  • 346.
  • 347.
  • 348.
  • 349.
  • 350.
  • 351.
  • 352.
  • 353.
  • 354.
  • 355.
  • 356.
  • 357.
  • 358.
  • 359.
  • 360.
  • 361.
  • 362.
  • 363.
  • 364.
  • 365.
  • 366.
  • 367.
  • 368.
  • 369.
  • 370.
  • 371.
  • 372.
  • 373.
  • 374.
  • 375.
  • 376.
  • 377.
  • 378.
  • 379.
  • 380.
  • 381.
  • 382.
  • 383.
  • 384.
  • 385.
  • 386.
  • 387.
  • 388.
  • 389.
  • 390.
  • 391.
  • 392.
  • 393.
  • 394.
  • 395.
  • 396.
  • 397.
  • 398.
  • 399.
  • 400.
  • 401.
  • 402.
  • 403.
  • 404.
  • 405.
  • 406.
  • 407.
  • 408.
  • 409.
  • 410.
  • 411.
  • 412.
  • 413.
  • 414.
  • 415.
  • 416.
  • 417.
  • 418.
  • 419.
  • 420.
  • 421.
  • 422.
  • 423.
  • 424.
  • 425.
  • 426.
  • 427.
  • 428.
  • 429.
  • 430.
  • 431.
  • 432.
  • 433.
  • 434.
  • 435.
  • 436.
  • 437.
  • 438.
  • 439.
  • 440.
  • 441.
  • 442.
  • 443.
  • 444.
  • 445.
  • 446.
  • 447.
  • 448.
  • 449.
  • 450.
  • 451.
  • 452.
  • 453.
  • 454.
  • 455.
  • 456.
  • 457.
  • 458.
  • 459.
  • 460.
  • 461.
  • 462.
  • 463.
  • 464.
  • 465.
  • 466.
  • 467.
  • 468.
  • 469.
  • 470.
  • 471.
  • 472.
  • 473.
  • 474.
  • 475.
  • 476.
  • 477.
  • 478.
  • 479.
  • 480.
  • 481.
  • 482.
  • 483.
  • 484.
  • 485.
  • 486.
  • 487.
  • 488.
  • 489.
  • 490.
  • 491.
  • 492.
  • 493.
  • 494.
  • 495.
  • 496.
  • 497.
  • 498.
  • 499.
  • 500.
  • 501.
  • 502.
  • 503.
  • 504.
  • 505.
  • 506.
  • 507.
  • 508.
  • 509.
  • 510.
  • 511.
  • 512.
  • 513.
  • 514.
  • 515.
  • 516.
  • 517.
  • 518.
  • 519.
  • 520.
  • 521.
  • 522.
  • 523.
  • 524.
  • 525.
  • 526.
  • 527.
  • 528.
  • 529.
  • 530.
  • 531.
  • 532.
  • 533.
  • 534.
  • 535.
  • 536.
  • 537.
  • 538.
  • 539.
  • 540.
  • 541.
  • 542.
  • 543.
  • 544.
  • 545.
  • 546.
  • 547.
  • 548.
  • 549.
  • 550.
  • 551.
  • 552.
  • 553.
  • 554.
  • 555.
  • 556.
  • 557.
  • 558.
  • 559.
  • 560.
  • 561.
  • 562.
  • 563.
  • 564.
  • 565.
  • 566.
  • 567.
  • 568.
  • 569.
  • 570.
  • 571.
  • 572.
  • 573.
  • 574.
  • 575.
  • 576.
  • 577.
  • 578.
  • 579.
  • 580.
  • 581.
  • 582.
  • 583.
  • 584.
  • 585.
  • 586.
  • 587.
  • 588.
  • 589.
  • 590.
  • 591.
  • 592.
  • 593.
  • 594.
  • 595.
  • 596.
  • 597.
  • 598.
  • 599.
  • 600.
  • 601.
  • 602.
  • 603.
  • 604.
  • 605.
  • 606.
  • 607.
  • 608.
  • 609.
  • 610.
  • 611.
  • 612.
  • 613.
  • 614.
  • 615.
  • 616.
  • 617.
  • 618.
  • 619.
  • 620.
  • 621.
  • 622.
  • 623.
  • 624.
  • 625.
  • 626.
  • 627.
  • 628.
  • 629.
  • 630.
  • 631.
  • 632.
  • 633.
  • 634.
  • 635.
  • 636.
  • 637.
  • 638.
  • 639.
  • 640.
  • 641.
  • 642.
  • 643.
  • 644.
  • 645.
  • 646.
  • 647.
  • 648.
  • 649.
  • 650.
  • 651.
  • 652.
  • 653.
  • 654.
  • 655.
  • 656.
  • 657.
  • 658.

C#操作Word表格的实现实例就向你介绍到这里,希望对你学习和了解C#操作Word表格有所帮助。

【编辑推荐】

  1. C#操作符重载的那点事儿
  2. C#操作符重载特点实例浅析
  3. C#操作Word书签实例浅析
  4. C#操作Word表的实例浅析
  5. C#操作Word表格的常见操作
责任编辑:仲衡 来源: 博客园
相关推荐

2009-08-19 10:42:08

C#操作Word表格

2009-08-19 10:25:14

C#操作Word

2009-08-19 11:13:49

C#操作Word

2009-08-19 11:34:06

C#操作Word

2009-08-19 09:42:52

C#操作Word书签

2009-08-19 11:28:41

C#操作Word

2009-09-01 13:51:51

C#创建Word文档

2009-09-01 13:13:28

C#打开Word文档

2009-09-01 11:25:08

C#读取Word文件

2009-08-19 10:16:15

C#操作Word

2009-08-28 17:34:14

读取word文档

2009-08-20 11:01:51

C#操作内存

2009-08-19 16:09:15

C#操作Access

2009-08-18 13:49:21

C# 操作Excel

2009-09-01 11:21:02

C#读取word内容

2009-08-26 13:48:31

C#打印条码

2009-08-19 11:23:12

C#操作Word

2009-08-31 18:38:59

C#写文件

2009-08-18 17:05:08

C#操作xml文件

2009-08-18 16:04:12

C# 操作Excel
点赞
收藏

51CTO技术栈公众号