The following wapp is a predefined Word document engineering variable.
The following code modifies word paragraph indents, paragraph spacing, line spacing, paging, and so on through VBA code.
Paragraph format setting
WApp.Selection.ParagraphFormat.LeftIndent = wapp.centimeterstopoints (float. Parse ("0"))//left Indent
WApp.Selection.ParagraphFormat.RightIndent = wapp.centimeterstopoints (float. Parse ("0"))//Right Indent
WApp.Selection.ParagraphFormat.SpaceBefore =float. Parse ("0");//spacing before paragraph
WApp.Selection.ParagraphFormat.SpaceBeforeAuto =0;//
WApp.Selection.ParagraphFormat.SpaceAfter = float. Parse ("0")//After paragraph spacing
WApp.Selection.ParagraphFormat.SpaceAfterAuto = 0;//
WApp.Selection.ParagraphFormat.LineSpacingRule = microsoft.office.interop.word.wdlinespacing.wdlinespacesingle;/ /single Spacing
WApp.Selection.ParagraphFormat.Alignment = microsoft.office.interop.word.wdparagraphalignment.wdalignparagraphjustify;//paragraph 2-side alignment
WApp.Selection.ParagraphFormat.WidowControl = 0;//Orphan control
WApp.Selection.ParagraphFormat.KeepWithNext = 0;//the same page as the next paragraph
WApp.Selection.ParagraphFormat.KeepTogether = no paging in 0;//segment
WApp.Selection.ParagraphFormat.PageBreakBefore = 0;//paragraph before pagination
WApp.Selection.ParagraphFormat.NoLineNumber = 0;//Cancel line number
WApp.Selection.ParagraphFormat.Hyphenation = 1;//Cancel paragraph word
WApp.Selection.ParagraphFormat.FirstLineIndent = wapp.centimeterstopoints (float. Parse ("0"))//Indent first line
WApp.Selection.ParagraphFormat.OutlineLevel = Microsoft.Office.Interop.Word.WdOutlineLevel.wdOutlineLevelBodyText;
WApp.Selection.ParagraphFormat.CharacterUnitLeftIndent = float. Parse ("0");
WApp.Selection.ParagraphFormat.CharacterUnitRightIndent = float. Parse ("0");
WApp.Selection.ParagraphFormat.CharacterUnitFirstLineIndent = float. Parse ("0");
WApp.Selection.ParagraphFormat.LineUnitBefore = float. Parse ("0");
WApp.Selection.ParagraphFormat.LineUnitAfter = float. Parse ("0");
WApp.Selection.ParagraphFormat.AutoAdjustRightIndent = 1;
WApp.Selection.ParagraphFormat.DisableLineHeightGrid = 0;
WApp.Selection.ParagraphFormat.FarEastLineBreakControl = 1;
WApp.Selection.ParagraphFormat.WordWrap = 1;
WApp.Selection.ParagraphFormat.HangingPunctuation = 1;
WApp.Selection.ParagraphFormat.HalfWidthPunctuationOnTopOfLine = 0;
WApp.Selection.ParagraphFormat.AddSpaceBetweenFarEastAndAlpha = 1;
WApp.Selection.ParagraphFormat.AddSpaceBetweenFarEastAndDigit = 1;
WApp.Selection.ParagraphFormat.BaseLineAlignment = Microsoft.Office.Interop.Word.WdBaselineAlignment.wdBaselineAlignAuto;