要先設定是不太可能的,可以先輸入內容,完成後用宏一次性全部處理即可。參考如下宏程式碼:Sub Qxhh() With ActiveDocument.Content.Find .ClearFormatting .Replacement.ClearFormatting .Execute findtext:="[^11^13]{1,}", replacewith:="^p", _ MatchWildcards:=True, Replace:=wdReplaceAll End With Selection.HomeKey wdStory Selection.EndKey wdLine Do While Selection.Range.End ActiveDocument.Content.End - 1 If Not Range(Selection.Range.End, Selection.Range.End + 1) Like vbCr Then Selection.TypeParagraph Selection.TypeParagraph Else Selection.TypeParagraph Selection.MoveRight End If Selection.EndKey wdLine LoopEnd Sub
要先設定是不太可能的,可以先輸入內容,完成後用宏一次性全部處理即可。參考如下宏程式碼:Sub Qxhh() With ActiveDocument.Content.Find .ClearFormatting .Replacement.ClearFormatting .Execute findtext:="[^11^13]{1,}", replacewith:="^p", _ MatchWildcards:=True, Replace:=wdReplaceAll End With Selection.HomeKey wdStory Selection.EndKey wdLine Do While Selection.Range.End ActiveDocument.Content.End - 1 If Not Range(Selection.Range.End, Selection.Range.End + 1) Like vbCr Then Selection.TypeParagraph Selection.TypeParagraph Else Selection.TypeParagraph Selection.MoveRight End If Selection.EndKey wdLine LoopEnd Sub