Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Misha Misha is offline
external usenet poster
 
Posts: 18
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Cindy M -WordMVP- Cindy M  -WordMVP- is offline
external usenet poster
 
Posts: 370
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I create Word macro that will run properly using copy/past. Joye Microsoft Word Help 1 June 23rd 06 10:41 PM
Spell check not working properly? [email protected] New Users 1 April 12th 06 03:16 AM
Mail merge not working properly Diane Hazen Mailmerge 10 August 22nd 05 07:58 PM
spell check in MS word 2000 is not working properly peopleperson Microsoft Word Help 3 November 28th 04 11:41 PM
Why is my spell check randomly not working properly? J. P. Holcombe Microsoft Word Help 2 November 24th 04 07:45 PM


All times are GMT +1. The time now is 04:27 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"