C#操作word表格怎么给一个单元格内的一段文字加下划线
2个回答
展开全部
//插入下划线
public void InsertUnderLine(string pText, int pFontSize, Microsoft.Office.Interop.Word.WdColor pFontColor, int pFontBold, Microsoft.Office.Interop.Word.WdParagraphAlignment ptextAlignment)
{
this._wordApplication.Application.Selection.TypeText(pText); //pText就是你要设置下划线的内容
this._wordApplication.Application.Selection.Font.Underline = Microsoft.Office.Interop.Word.WdUnderline.wdUnderlineSingle; //设置下划线
}
public void InsertUnderLine(string pText, int pFontSize, Microsoft.Office.Interop.Word.WdColor pFontColor, int pFontBold, Microsoft.Office.Interop.Word.WdParagraphAlignment ptextAlignment)
{
this._wordApplication.Application.Selection.TypeText(pText); //pText就是你要设置下划线的内容
this._wordApplication.Application.Selection.Font.Underline = Microsoft.Office.Interop.Word.WdUnderline.wdUnderlineSingle; //设置下划线
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询