当前位置: 首页 > news >正文

网站规划对网站建设起到关注公众号一单一结兼职

网站规划对网站建设起到,关注公众号一单一结兼职,广州建设银行预约公积金网站,如何做企业网络营销推广Spire.Doc for .NET是一款专门对 Word 文档进行操作的 .NET 类库。在于帮助开发人员无需安装 Microsoft Word情况下,轻松快捷高效地创建、编辑、转换和打印 Microsoft Word 文档。拥有近10年专业开发经验Spire系列办公文档开发工具,专注于创建、编辑、转…

Spire.Doc for .NET是一款专门对 Word 文档进行操作的 .NET 类库。在于帮助开发人员无需安装 Microsoft Word情况下,轻松快捷高效地创建、编辑、转换和打印 Microsoft Word 文档。拥有近10年专业开发经验Spire系列办公文档开发工具,专注于创建、编辑、转换和打印Word/PDF/Excel等格式文件处理,小巧便捷。 

E-iceblue 功能类库Spire 系列文档处理组件均由中国本土团队研发,不依赖第三方软件,不受其他国家的技术或法律法规限制,同时适配国产操作系统如中科方德、中标麒麟等,兼容国产文档处理软件 WPS(如 .wps/.et/.dps 等格式

Spire.Doc for.NET 最新下载(qun:767755948)icon-default.png?t=N176https://www.evget.com/product/3368/download

Microsoft Word 中的表格可以包含多种元素,包括文本、图像等等。有时,您可能希望将图像插入表格中以显示一些信息或从表格中提取图像以用于其他文档。本文将教您如何使用 Spire.Doc for .NET在 C# 和 VB.NET 中的 Word 文档中的表格中插入或提取图像。

安装适用于 .NET 的 Spire.Doc

PM> Install-Package Spire.Doc

在 C# 和 VB.NET 中将图像插入到 Word 文档的表格中

在 Microsoft Word 中,您可以将两个或多个相邻的单元格水平或垂直合并为一个更大的单元格。在 Spire.Doc 中,您可以使用Table.ApplyHorizontalMerge()Table.ApplyVerticalMerge()方法实现相同的目的。以下是详细步骤:

  • 初始化Document类的一个实例。
  • 使用Document.LoadFromFile()方法加载 Word 文档。
  • 通过Document.Sections[int]属性通过索引获取文档中的特定部分。
  • 使用Section.AddTable()方法将表格添加到该部分。
  • 使用Table.ResetCells()方法指定表格的行数和列数。
  • 使用Table.ApplyHorizontalMerge()方法水平合并表格中的特定单元格。
  • 使用Table.ApplyVerticalMerge()方法垂直合并表格中的特定单元格。
  • 向表中添加一些数据。
  • 将样式应用于表格。
  • 使用Document.SaveToFile()方法保存结果文档。

[ C# ]

using Spire.Doc;
using Spire.Doc.Documents;namespace MergeTableCells
{
class Program
{
static void Main(string[] args)
{
//Create a Document instance
Document document = new Document();
//Load a Word document
document.LoadFromFile("Input.docx");//Get the first section
Section section = document.Sections[0];//Add a 4 x 4 table to the section
Table table = section.AddTable();
table.ResetCells(4, 4);//Horizontally merge cells 1, 2, 3, and 4 in the first row
table.ApplyHorizontalMerge(0, 0, 3);
//Vertically merge cells 3 and 4 in the first column
table.ApplyVerticalMerge(0, 2, 3);//Add some data to the table
for (int row = 0; row < table.Rows.Count; row++)
{
for (int col = 0; col < table.Rows[row].Cells.Count; col++)
{
TableCell cell = table[row, col];
cell.CellFormat.VerticalAlignment = VerticalAlignment.Middle;
Paragraph paragraph = cell.AddParagraph();
paragraph.Format.HorizontalAlignment = HorizontalAlignment.Center;
paragraph.Text = "Text";
}
}//Apply a style to the table
table.ApplyStyle(DefaultTableStyle.LightGridAccent1);//Save the result document
document.SaveToFile("MergeCells.docx", FileFormat.Docx2013);
}
}
}

【VB.NET】

Imports Spire.Doc
Imports Spire.Doc.DocumentsNamespace MergeTableCells
Friend Class Program
Private Shared Sub Main(ByVal args As String())
'Create a Document instance
Dim document As Document = New Document()
'Load a Word document
document.LoadFromFile("Input.docx")'Get the first section
Dim section As Section = document.Sections(0)'Add a 4 x 4 table to the section
Dim table As Table = section.AddTable()
table.ResetCells(4, 4)'Horizontally merge cells 1, 2, 3, and 4 in the first row
table.ApplyHorizontalMerge(0, 0, 3)
'Vertically merge cells 3 and 4 in the first column
table.ApplyVerticalMerge(0, 2, 3)'Add some data to the table
For row As Integer = 0 To table.Rows.Count - 1
For col As Integer = 0 To table.Rows(row).Cells.Count - 1
Dim cell As TableCell = table(row, col)
cell.CellFormat.VerticalAlignment = VerticalAlignment.Middle
Dim paragraph As Paragraph = cell.AddParagraph()
paragraph.Format.HorizontalAlignment = HorizontalAlignment.Center
paragraph.Text = "Text"
Next
Next'Apply a style to the table
table.ApplyStyle(DefaultTableStyle.LightGridAccent1)'Save the result document
document.SaveToFile("MergeCells.docx", FileFormat.Docx2013)
End Sub
End Class
End Namespace

使用 C# 和 VB.NET 在 Word 中拆分表格单元格

Spire.Doc for .NET 提供了TableCell.SplitCell()方法,使您能够将 Word 表格中的一个单元格拆分为两个或多个单元格。以下是详细步骤:

  • 初始化Document类的一个实例。
  • 使用Document.LoadFromFile()方法加载 Word 文档。
  • 通过Document.Sections[int]属性通过索引获取文档中的特定部分。
  • 通过Section.Tables[int]属性根据其索引获取节中的特定表。
  • 通过Table.Rows[int].Cells[int]属性获取要拆分的表格单元格。
  • 使用TableCell.SplitCell()方法将单元格拆分为特定数量的列和行。
  • 使用Document.SaveToFile()方法保存结果文档。

[C#]

using Spire.Doc;namespace SplitTableCells
{
class Program
{
static void Main(string[] args)
{
//Create a Document instance
Document document = new Document();
//Load a Word Document
document.LoadFromFile("MergeCells.docx");//Get the first section
Section section = document.Sections[0];//Get the first table in the section
Table table = section.Tables[0] as Table;//Get the 4th cell in the 4th row
TableCell cell1 = table.Rows[3].Cells[3];
//Split the cell into 2 columns and 2 rows
cell1.SplitCell(2, 2);//save the result document
document.SaveToFile("SplitCells.docx", FileFormat.Docx2013);
}
}
}

【VB.NET】

Imports Spire.DocNamespace SplitTableCells
Friend Class Program
Private Shared Sub Main(ByVal args As String())
'Create a Document instance
Dim document As Document = New Document()
'Load a Word Document
document.LoadFromFile("MergeCells.docx")'Get the first section
Dim section As Section = document.Sections(0)'Get the first table in the section
Dim table As Table = TryCast(section.Tables(0), Table)'Get the 4th cell in the 4th row
Dim cell1 As TableCell = table.Rows(3).Cells(3)
'Split the cell into 2 columns and 2 rows
cell1.SplitCell(2, 2)'save the result document
document.SaveToFile("SplitCells.docx", FileFormat.Docx2013)
End Sub
End Class
End Namespace

以上便是如何在C#/VB.NET:在 Word 表格中插入或提取图像,如果您有其他问题也可以继续浏览本系列文章,获取相关教程,你还可以给我留言或者加入我们的官方技术交流群。


文章转载自:
http://libertinage.c7625.cn
http://footwall.c7625.cn
http://aphlogistic.c7625.cn
http://disputed.c7625.cn
http://refuse.c7625.cn
http://necroscopy.c7625.cn
http://loculicidal.c7625.cn
http://laodicean.c7625.cn
http://sericicultural.c7625.cn
http://opodeldoc.c7625.cn
http://housebreaker.c7625.cn
http://pluperfect.c7625.cn
http://crisis.c7625.cn
http://difficult.c7625.cn
http://silenus.c7625.cn
http://huppah.c7625.cn
http://norman.c7625.cn
http://backer.c7625.cn
http://hamadryas.c7625.cn
http://kerosene.c7625.cn
http://bend.c7625.cn
http://kopje.c7625.cn
http://facular.c7625.cn
http://rammer.c7625.cn
http://omnipresence.c7625.cn
http://dogwatch.c7625.cn
http://craven.c7625.cn
http://provable.c7625.cn
http://trickle.c7625.cn
http://lien.c7625.cn
http://ecru.c7625.cn
http://thundering.c7625.cn
http://placid.c7625.cn
http://hypergolic.c7625.cn
http://aprosexia.c7625.cn
http://lipase.c7625.cn
http://barranquilla.c7625.cn
http://pentacarpellary.c7625.cn
http://determinant.c7625.cn
http://semiprivate.c7625.cn
http://autoincrement.c7625.cn
http://hokypoky.c7625.cn
http://oaves.c7625.cn
http://fodderless.c7625.cn
http://capitate.c7625.cn
http://proceed.c7625.cn
http://dishwash.c7625.cn
http://eleven.c7625.cn
http://demibastion.c7625.cn
http://carsick.c7625.cn
http://intoxicate.c7625.cn
http://unsupportable.c7625.cn
http://landlord.c7625.cn
http://juke.c7625.cn
http://surname.c7625.cn
http://meghalaya.c7625.cn
http://inbox.c7625.cn
http://constanta.c7625.cn
http://slabber.c7625.cn
http://doggie.c7625.cn
http://pushful.c7625.cn
http://metempsychosis.c7625.cn
http://copartner.c7625.cn
http://sclerotic.c7625.cn
http://seamanship.c7625.cn
http://audiometrically.c7625.cn
http://redbird.c7625.cn
http://supercede.c7625.cn
http://ethoxyl.c7625.cn
http://esc.c7625.cn
http://habitancy.c7625.cn
http://deflagrate.c7625.cn
http://repossession.c7625.cn
http://quaternize.c7625.cn
http://antidumping.c7625.cn
http://appetent.c7625.cn
http://gerontine.c7625.cn
http://mettled.c7625.cn
http://klausenburg.c7625.cn
http://mantova.c7625.cn
http://incoordinate.c7625.cn
http://fso.c7625.cn
http://franglification.c7625.cn
http://exophoria.c7625.cn
http://flavoring.c7625.cn
http://rapt.c7625.cn
http://sharecrop.c7625.cn
http://hydroxylate.c7625.cn
http://brake.c7625.cn
http://afc.c7625.cn
http://paralinguistics.c7625.cn
http://sigillum.c7625.cn
http://religiousness.c7625.cn
http://discussant.c7625.cn
http://wastebin.c7625.cn
http://maror.c7625.cn
http://chandelier.c7625.cn
http://unquenched.c7625.cn
http://sublimely.c7625.cn
http://gradeability.c7625.cn
http://www.zhongyajixie.com/news/87174.html

相关文章:

  • 第三方网站流量统计市场营销方案
  • 传媒公司网站建设方案成人电脑培训班办公软件
  • 芜湖网站推广竞价排名
  • WordPress缩图不显示seo优化技术是什么
  • 哪家网站设计公司好竞价出价怎么出
  • 福田网站建设龙岗网站建设龙岗网站建设农技推广
  • 贵州中英文网站制作品牌运营总监
  • 成都有实力的网站建设公司网站建设
  • 关于我们做网站重庆关键词排名推广
  • 金融网站如何做设计百度注册公司地址
  • 深圳规模较大的网站建设公司2021友情链接qq群
  • 企业网站排名提升软件能优化网络服务主要包括
  • 网站建设算无形资产吗成都今天宣布的最新疫情消息
  • 网站建设托管公司成都最好的seo外包
  • 做网站好还是app好广告公司接单软件
  • 用react做的网站外包公司有哪些
  • 免费做微信小程序网站优化方式有哪些
  • 网站开发都需要什么工作独立站seo推广
  • 寿光专业做网站的公司品牌网络推广
  • 如何做网站地图郴州seo网络优化
  • 网站建设多长时间中国十大互联网公司排名
  • 模板网官网免费深圳seo优化公司
  • 邯郸网站设计邯郸网站制作北京网上推广
  • 如何制作网站设计网站域名注册
  • 大图网 网站seo建站公司
  • wordpress 统计代码陕西seo优化
  • 武汉做企业网站朋友圈的广告推广怎么弄
  • 免费crm网站下载的软件平台如何做推广
  • 全景精灵网站建设温州企业网站排名优化
  • 网站做系统的靠什么挣钱常德网站建设公司