Word首行左缩进真正置零代码(不细心的话,简直就是一个坑!)

wordApp.Selection.ClearParagraphAllFormatting();
wordApp.Selection.ParagraphFormat.CharacterUnitFirstLineIndent = 0;
wordApp.Selection.ParagraphFormat.FirstLineIndent = 0;

第一句:清除所有段落格式

第二句:字符单位式首行缩进置零

第三句:首行缩进置零

先第二句再第三句,这样能够保证手工空格生成的首行左缩进强制置零,否则制服不了!

猜你喜欢

转载自www.cnblogs.com/kunda/p/10269619.html