Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Macro not working properly
I have recorded a macro to find two consecutive paragraph marks and replace
them with one paragraph mark, formatted with 12pt spacing after. THis works, but also puts a border round the text. I do not really understand Visual Basic, and therefore cannot edit the macro. Could someone please help? Below is the macro: Sub RemoveTwooParaMarks() ' ' RemoveTwooParaMarks Macro ' Remove 2 para marks replace with one para mark format 12 pt spacing after ' Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find.Replacement.ParagraphFormat .SpaceBeforeAuto = False .SpaceAfter = 12 .SpaceAfterAuto = False .LineUnitAfter = 0 End With Selection.Find.Replacement.ParagraphFormat.Borders .Shadow = False With Selection.Find .Text = "^p^p" .Replacement.Text = "^p" .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll End Sub |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Macro not working properly
Hi Misha,
Try deleting the one line in your macro that mentions "Borders". I think that's turning the borders on. No idea why the macro recorder put that in, but you don't need it. I have recorded a macro to find two consecutive paragraph marks and replace them with one paragraph mark, formatted with 12pt spacing after. THis works, but also puts a border round the text. I do not really understand Visual Basic, and therefore cannot edit the macro. Could someone please help? Below is the macro: Sub RemoveTwooParaMarks() ' ' RemoveTwooParaMarks Macro ' Remove 2 para marks replace with one para mark format 12 pt spacing after ' Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find.Replacement.ParagraphFormat .SpaceBeforeAuto = False .SpaceAfter = 12 .SpaceAfterAuto = False .LineUnitAfter = 0 End With Selection.Find.Replacement.ParagraphFormat.Borders .Shadow = False With Selection.Find .Text = "^p^p" .Replacement.Text = "^p" .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll End Sub Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I create Word macro that will run properly using copy/past. | Microsoft Word Help | |||
Spell check not working properly? | New Users | |||
Mail merge not working properly | Mailmerge | |||
spell check in MS word 2000 is not working properly | Microsoft Word Help | |||
Why is my spell check randomly not working properly? | Microsoft Word Help |