Style change code

G

Gwendor

Can anyone tell give me a code that will let me change a certain style
(norm1) per another (norm2).

What i do is inserting one line between each paragraph of a newly
scanned book with its own style. but when i do insert the new line, this
one keep the style of the precedent paragraph which is not what i need.
I need a new line with a non specialized style.

For inserting the new line I use replacement of "^p" by "^p^p".

I can replace it by "^p~^p" to get a new line with "~^p" that I would
replace with the new style I want.

Each time try to do it by macro the code create a border around the
newly changed line while executing it as a new macro code.

I hope i am clear.
 
D

Doug Robbins - Word MVP

The following will insert a paragraph after the one in which the selection
is located and format it with the Heading 1 style

Dim myrange As Range
Set myrange = Selection.Paragraphs(1).Range
myrange.Collapse wdCollapseEnd
myrange.InsertAfter vbCr
myrange.Style = "Heading 1"


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

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