乔山办公网我们一直在努力
您的位置:乔山办公网 > word文档 > word官方下载-工业级Word控件 Spire.Doc系列教程:创建 Word 艺术字

word官方下载-工业级Word控件 Spire.Doc系列教程:创建 Word 艺术字

作者:乔山办公网日期:

返回目录:word文档

在编辑word文档时,我们会为文档添加艺术字,让文档更美观和具有吸引力。Spire.Doc里通过ShapeType枚举类型,我们可以添加多种类型的艺术字,并实例化一个ShapeObject来设置艺术字的类型,并添加艺术字内容和设置其样式。 本文将详细介绍如何使用Spire.Doc创建艺术字并设置样式和效果。


【C#】


//实例化一个word Document并添加一个section和段落Document doc = new Document();Section section = doc.AddSection(); Paragraph paragraph = section.AddParagraph();//添加一个Shape,并设置其大小和样式ShapeObject shape = paragraph.AppendShape(240, 60, ShapeType.TextWave);//设置shape的位置shape.VerticalPosition = 80;shape.HorizontalPosition = 100;//写入艺术字文本和设置斜体shape.WordArt.Text = "艺术字效果";shape.WordArt.Italic = true;//设置文字填充样式shape.FillColor = System.Drawing.Color.Red;shape.StrokeColor = System.Drawing.Color.Gray; //保存文档 doc.SaveToFile("Output.docx", FileFormat.Docx2013);

【VB.NET】


Dim doc As New Document()Dim section As Section = doc.AddSection()Dim paragraph As Paragraph = section.AddParagraph()Dim shape As ShapeObject = paragraph.AppendShape(240, 60, ShapeType.TextWave)shape.VerticalPosition = 80shape.HorizontalPosition = 100shape.WordArt.Text = "艺术字效果"shape.WordArt.Italic = Trueshape.FillColor = System.Drawing.Color.Redshape.StrokeColor = System.Drawing.Color.Graydoc.SaveToFile("Output.docx", FileFormat.Docx2013)

效果图:


点击“了解更多”下载产品最新版


↓↓↓


相关阅读

  • excel表格打不开-EXCEL表格不能改咋办?

  • 乔山办公网excel表格制作
  • 除了黄色区域,其他都不能修改,不能看公式当然得解锁,找出密码来!粘贴上这些代码:代码在文末点击运行按钮:结果很快呈现:is后这一串就是密码可以用此密码,解锁文件。-e
关键词不能为空
极力推荐

ppt怎么做_excel表格制作_office365_word文档_365办公网