Spire.Doc 图片和形状教程(3):C# 创建 Word 艺术字

下载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)

 

效果图:

添加艺术字效果图

想看冰蓝更多产品教程吗你推荐:

Spire.PDF系列教程>>

Spire.XLS系列教程>>


想要购买正版授权,或者获取更多Spire.Doc相关信息的朋友可以点击” 咨询在线客服 “~

315特惠

标签:文档管理Officeword文档处理

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2019年1月22日
下一篇 2019年1月22日

相关推荐

发表回复

登录后才能评论