Formatting of text problem - Help needed with Style Sheets & Search and Replace

C

Centurion

Hiya

I'm just totally stumped at this one. I have a text document from an online
form (see below), and I'm trying to format each section individually to a
seperate style using the search and replace command.

The text will be exactly like this.

FORM START

Name : Blah
Area : Blah 2

Region : Blah 3


PDS1:
--------------------------------------------------------------------------
Ajjjj jkfgj kdfjgkd fjkjfgkd fjgkdf jgkjkfdj kjfd dsf dsgfsdgdg dsg sdg
sdgs sdg sdgs sdg ds sdg sdfg sdgsgsg gsgdsggs sdgsdgs sdgsdgsg sdgsg
sdgsd sdgsdgs sd sdg sdgsdgsg sdgsdg sdgsdgsdg
--------------------------------------------------------------------------

Contact name & tel: Blah4

PCE : 82834
STRP : NEW
CODE : 54321



FORM END



The data will change every time but the fieldnames (Name, Area, Region etc)
will stay the same. So one form might be Name : Blah and the next time Name
: Halb and so on. I want to be able to change each line to a seperate Style
using the search and replace command.



I'm trying to do a search saying :



Replace "Name : " with "Name : " with a new style sheet selected. Obviously
doing a search and replace for "Name : Blah" would be pointless as it's
going to change every new form.



Now every time I do this the entire document changes to the new style, which
is not what I'm looking for. I'm looking that every *section* of the data
above has a different style sheet, so "Name : Blah" would be Style 1. "Area
: Blah2" would be Style 2, "Region : Blah3" would be Style 3 and so on.



Is there *anyway* of doing this. I would be pulling my hair out if I had any
left, so can anyone please help.



Thanks for listening



JD
 
M

mpt

I was able to create a macro to search for unique text on a line, such as
"Region" and then change the style to something like "Bullet 1."

Could you create and debug a macro to do the same for one line of text then
duplicate the code in that macro as many times as you have a change to be
made, then edit the text for each subsection and add the unique text for
each of the other lines you want to change?

Didn't know you could change styles with S&R. Thanks for the tip.

RIchard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top