文本居中怎么設置?
oPara1.Range.Text="我需要居中"; //插入文本
oPara1.Range.ParagraphFormat.Alignment =Word.WdParagraphAlignment.wdAlignParagraphCenter; //我的意圖是讓這段文字居中,但這樣做是不行的
把這兩句調換順序試試……
如果不行的話,我的寫法是這樣的:
Object Nothing = System.Reflection.Missing.Value;
worddoc.Paragraphs.Last.Alignment = WdParagraphAlignment.wdAlignParagraphCenter;
worddoc.Paragraphs.Last.Range.Text = "我需要居中";
worddoc.Paragraphs.Add(ref Nothing);
worddoc.Paragraphs.Last.Alignment = WdParagraphAlignment.wdAlignParagraphRight;
worddoc.Paragraphs.Last.Range.Text = "我需要右對齊";
上一篇大氣平衡閥工作原理
下一篇公共戶口薄是什么意思