Created
September 12, 2019 07:30
-
-
Save palikhov/a4f6e7515ad060c07c955780e6f5bf74 to your computer and use it in GitHub Desktop.
macro to clear wiki formatting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub wikiformattingclearing() | |
Selection.Find.Execute Replace:=wdReplaceAll | |
Selection.Font.Reset | |
Selection.Find.ClearFormatting | |
Selection.Find.Replacement.ClearFormatting | |
With Selection.Find | |
.Text = "[edit]" | |
.Replacement.Text = "" | |
.Forward = True | |
.Wrap = wdFindContinue | |
.Format = False | |
.MatchCase = False | |
.MatchWholeWord = False | |
.MatchWildcards = False | |
.MatchSoundsLike = False | |
.MatchAllWordForms = False | |
End With | |
Selection.Find.Execute Replace:=wdReplaceAll | |
Selection.Copy | |
Selection.Find.ClearFormatting | |
Selection.Find.Replacement.ClearFormatting | |
With Selection.Find | |
.Text = " • " | |
.Replacement.Text = " - " | |
.Forward = True | |
.Wrap = wdFindAsk | |
.Format = False | |
.MatchCase = False | |
.MatchWholeWord = False | |
.MatchWildcards = False | |
.MatchSoundsLike = False | |
.MatchAllWordForms = False | |
End With | |
Selection.Find.Execute Replace:=wdReplaceAll | |
Selection.Cut | |
Selection.Find.ClearFormatting | |
Selection.Find.Replacement.ClearFormatting | |
With Selection.Find | |
.Text = "• " | |
.Replacement.Text = "" | |
.Forward = True | |
.Wrap = wdFindContinue | |
.Format = False | |
.MatchCase = False | |
.MatchWholeWord = False | |
.MatchWildcards = False | |
.MatchSoundsLike = False | |
.MatchAllWordForms = False | |
End With | |
Selection.Find.Execute Replace:=wdReplaceAll | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment