下面的函数功能,实现的是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);
}