![]() |
|
|
|
#1
|
||||
|
||||
|
See the macro here for a comprehensive solution: https://www.msofficeforums.com/word/...html#post32907
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#2
|
|||
|
|||
|
Thanks for the replies, and sorry for posting in the wrong forum. The text of the macro in question is below. I think that's it anyway, I'm fairly new at all this. Can I edit it in some way to prevent the dialogs? If so, please give instructions if possible. I've never done it before but could probably do it if guided through. Thanks a lot.
![]() Code:
Sub Macro2() ' ' Macro2 Macro ' Ctrl+ M Justify several paragraphs ' Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "zzz^p" .Replacement.Text = "zzz" .Forward = True .Wrap = wdFindAsk .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll With Selection.Find .Text = "^p" .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 With Selection.Find .Text = "zzz" .Replacement.Text = "^p^p" .Forward = True .Wrap = wdFindAsk .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Selection.ParagraphFormat.Alignment = wdAlignParagraphJustify End Sub Last edited by macropod; 05-13-2012 at 02:49 PM. Reason: Added code tags & formatting |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
VBA macros
|
tays01s | Word VBA | 6 | 08-03-2011 09:42 PM |
| Macros | Steveg | Word VBA | 0 | 08-18-2010 04:04 PM |
Macros
|
Desertwrangler | Word VBA | 6 | 06-25-2010 07:06 AM |
| macros | trancetheory | Outlook | 0 | 05-11-2010 09:31 AM |
Macros
|
krdzal | Excel | 1 | 04-06-2010 07:43 AM |