![]() |
|
#4
|
||||
|
||||
|
Using Building Blocks or a template would be a lot easier.
The basic problem with the macro is that the selection changes as you run it, which is why the formatting won't get applied to the paragraphs where you want it. If you insist on using a macro, you would have to do something like this instead: Code:
Sub ApplyDirectFormattingToText() Dim r As Range Set r = Selection.Range With r .Collapse wdCollapseEnd .InsertAfter "First paragraph" ' replace with your text! .InsertParagraphAfter .InsertAfter "Second paragraph" .InsertParagraphAfter .InsertAfter "Third paragraph" .InsertParagraphAfter .InsertAfter "Fourth paragraph" .Font.Name = "Arial" .ParagraphFormat.Alignment = wdAlignParagraphCenter .Paragraphs(1).Range.Font.Size = 16 .Paragraphs(1).Range.Font.Bold = True .Paragraphs(2).Range.Font.Size = 10 .Paragraphs(3).Range.Font.Size = 12 .Paragraphs(4).Range.Font.Size = 12 End With End Sub
__________________
Stefan Blom Microsoft Word MVP Microsoft 365 apps for business Windows 11 Professional |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Microsoft Word 2010 - Aligning table horizontally
|
SWEngineer | Word Tables | 4 | 07-20-2011 01:32 AM |
Run a Macro in Word 2010
|
Joyce301 | Word VBA | 3 | 04-29-2011 03:27 PM |
| Make text permanent in Microsoft Word 2010, how? | shaunzo101 | Word | 0 | 09-21-2010 08:27 PM |
| Please help with a macro in Microsoft Word 2007 | AKMMS | Word VBA | 0 | 06-23-2010 02:16 PM |
| Word 2003 macro to Word 2007 to 2010 to... | maruapo | Word VBA | 0 | 06-04-2010 03:43 PM |