#1
|
|||
|
|||
Add text to start of new paragraph
Hello,
I wondered if anyone could help with how to add text to the start of new paragraphs in a word document, either using a VBA code or with Find and Replace. I need to add <np> to the start of new paragraphs. I would prefer to do this within text I have selected (I'm not sure if this is possible). Within the selected text there will be headings that I don't want to add <np> to. Could anyone help with this? I've tried a number of things that don't work. Thanks. |
#2
|
||||
|
||||
This will tag any non-heading selected paragraphs
Code:
Sub TagParas() Dim aPar As Paragraph For Each aPar In Selection.Paragraphs If aPar.Range.ParagraphFormat.OutlineLevel = wdOutlineLevelBodyText Then aPar.Range.InsertBefore "<np>" End If Next aPar End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Insert Text at Start of Each Paragraph | JingleBelle | Word VBA | 5 | 04-16-2021 07:36 AM |
Inserting text from a Userform into a Field in a paragraph in a paragraph in a word document | storemaz | Word VBA | 1 | 03-13-2020 08:11 AM |
How to find all numbers that start with a paragraph? | csongi12xme | Word | 7 | 07-22-2014 07:55 AM |
Justify Paragraph Start position with VBA | jeff_kaufman | Word VBA | 2 | 11-09-2013 12:15 PM |
How to force the start of Style Paragraph to be small so that i don't get green under | Jamal NUMAN | Word | 1 | 07-11-2011 04:58 AM |