Actually, that's not all that difficult. You can record a macro in Word which simply records whatever you do... the problem then is editting the macro so that it becomes a bit more generic.
Here's an example to remove excess spaces:
Sub RemoveWhiteSpaces()
Selection.WholeStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^w"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Last edited by Kino; 09-05-2009 at 02:42 PM.
Reason: add macro
|