Dzwebs.Net

撰写电脑技术杂文十余年

aspose.word设置字体字号对齐方式

Admin | 2016-2-27 17:47:25 | 被阅次数 | 11548

温馨提示!

如果未能解决您的问题,请点击搜索;登陆可复制文章,点击登陆

  下面的函数功能,实现的是aspose.word设置字体字号对齐方式。

  public void WriteText(string strText, double conSize, bool conBold, string conAlign)
        {
            oWordApplic.Bold = conBold;
            oWordApplic.Font.Size = conSize;
            switch (conAlign)
            {
                case "left":
                    oWordApplic.ParagraphFormat.Alignment = ParagraphAlignment.Left;
                    break;
                case "center":
                    oWordApplic.ParagraphFormat.Alignment = ParagraphAlignment.Center;
                    break;
                case "right":
                    oWordApplic.ParagraphFormat.Alignment = ParagraphAlignment.Right;
                    break;
                default:
                    oWordApplic.ParagraphFormat.Alignment = ParagraphAlignment.Left;
                    break;
            }
            oWordApplic.Write(strText);
   
        }


网站备案号:

网站备案号:滇ICP备11001339号-7

版权属性:

Copyright 2007-2021-forever Inc. all Rights Reserved.

联系方式:

Email:dzwebs@126.com QQ:83539231