I'm hoping someone can help me figure this out (no coding experience, I've just cobbled together things by extensive reading). I'm an independent author, and I format my own manuscripts in MS Word for publication. I'd love to have a macro that helped me format the first paragraph of each chapter. I've used the following, but it requires me to go to each first paragraph and select the words I want to turn into 'small caps'
With Selection.Find .Text = "[a-z]{1,}" .MatchWildcards = True .MatchCase = True .Replacement.Font.Size = 9.5 .Execute Replace:=wdReplaceAll, Forward:=True, _ Wrap:=wdFindStop End With Selection.Range.Case = wdUpperCase With Selection.ParagraphFormat .LeftIndent = InchesToPoints(0) .RightIndent = InchesToPoints(0) .SpaceBefore = 0 .SpaceBeforeAuto = False .SpaceAfter = 0 .SpaceAfterAuto = False .LineSpacingRule = wdLineSpaceMultiple .LineSpacing = LinesToPoints(1) .Alignment = wdAlignParagraphJustify .WidowControl = True .KeepWithNext = False .KeepTogether = False .PageBreakBefore = False .NoLineNumber = False .Hyphenation = True .FirstLineIndent = InchesToPoints(0) .OutlineLevel = wdOutlineLevelBodyText .CharacterUnitLeftIndent = 0 .CharacterUnitRightIndent = 0 .CharacterUnitFirstLineIndent = 0 .LineUnitBefore = 0 .LineUnitAfter = 0 .MirrorIndents = False .TextboxTightWrap = wdTightNone .CollapsedByDefault = False End With
I'm basically looking for a version of this that would automatically select the first four words in each first paragraph of each chapter for the entire document (it could be by style, if that's easier, since the first paragraph has a distinct style from the Word 'Normal' style).
Thank you!
https://stackoverflow.com/questions/65909289/macro-for-formatting-word-document-by-style-paragraph January 27, 2021 at 05:08AM
没有评论:
发表评论