can style changes be put into macros?

C

Catherine

I have a lot of text editing to do in which I need to change styles. The
style changes cannot be global, unfortunately, because the text is so
inconsistent. The changes need to be done almost paragraph by paragraph. Is
there a way to make a macro of some kind to place in a custom button? I
think that would make the reformatted faster.

Also, if there is some other idea you have to help me out, that would be
great. thanks.
 
G

Graham Mayor

For the macro to be of any real benefit beyond the controls on the
formatting toolbar/ribbon it really needs to be able to identify and select
the paragraphs to automate the whole procedure, but clearly this is not
possible.

The following macro will select the paragraph the cursor is in, remove any
manual formatting and apply the Normal style. Whether that would help I
cannot say.

Editing other people's poorly formatted text is a pain in the >>>>>>

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
C

Catherine

Thank you, Graham. Did you intend to include a macro for changing to Normal
style?
 
G

Graham Mayor

Oops!

With Selection
.MoveUp Unit:=wdParagraph, Count:=1
.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdExtend
.Style = ActiveDocument.Styles("Normal")
.Font.Reset
.ParagraphFormat.Reset
End With

Change Normal style in the macro to whatever style you are using in the
document.


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
C

Catherine

Thank you!!

Graham Mayor said:
Oops!

With Selection
.MoveUp Unit:=wdParagraph, Count:=1
.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdExtend
.Style = ActiveDocument.Styles("Normal")
.Font.Reset
.ParagraphFormat.Reset
End With

Change Normal style in the macro to whatever style you are using in the
document.


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
H

Henk57

Catherine;2543492 said:
Thank you!!

:
-
Oops!

With Selection
.MoveUp Unit:=wdParagraph, Count:=1
.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdExtend
.Style = ActiveDocument.Styles("Normal")
.Font.Reset
.ParagraphFormat.Reset
End With

Change Normal style in the macro to whatever style you are using in
the
document.


--

Graham Mayor - Word MVP




Catherine wrote:-
Thank you, Graham. Did you intend to include a macro for changing to
Normal style?

:
-
For the macro to be of any real benefit beyond the controls on the
formatting toolbar/ribbon it really needs to be able to identify and
select the paragraphs to automate the whole procedure, but clearly
this is not possible.

The following macro will select the paragraph the cursor is in,
remove any manual formatting and apply the Normal style. Whether
that would help I cannot say.

Editing other people's poorly formatted text is a pain in the

--

Graham Mayor - Word MVP




Catherine wrote:
I have a lot of text editing to do in which I need to change styles.
The style changes cannot be global, unfortunately, because the text
is so inconsistent. The changes need to be done almost paragraph by
paragraph. Is there a way to make a macro of some kind to place in
a custom button? I think that would make the reformatted faster.

Also, if there is some other idea you have to help me out, that
would be great. thanks. --


-

FWIW, you can define a style, and go through the document and assign it
to the paragraphs you want. I implicitly assume that you have the
non-printing characters showing (press CTRL+SHIFT+8 if not) so you see
what you'r doing. The first time you assign the style, but for
changing the next instances you can use CTRL+Y (repeat last command).
You have to go through multiple passes (for each style, as you go
style-by-style), and you may lose overview, but personally I find this
way quicker (and RSI friendly).
 
G

Graham Mayor

Henk57 said:
FWIW, you can define a style, and go through the document and assign
it to the paragraphs you want. I implicitly assume that you have the
non-printing characters showing (press CTRL+SHIFT+8 if not) so you see
what you'r doing. The first time you assign the style, but for
changing the next instances you can use CTRL+Y (repeat last command).
You have to go through multiple passes (for each style, as you go
style-by-style), and you may lose overview, but personally I find this
way quicker (and RSI friendly).

This may work, but the problem with it is that it may not affect manual text
or paragraph formatting when you apply the new style to the text. Simply
re-applying the original style would be as effective, but has the same
provisos. The macro has the extra code required to remove such formatting.
(or manually CTRL+Space and CTRL+Q)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Suzanne S. Barnhill

Also, FWIW, note that manually applying the Clear Formatting "style" has the
effect of applying Normal style *and* removing direct font and paragraph
formatting.
 
C

Catherine

Is there a way, when doing this, to wipe out hard returns? Dealing with tThe
lack of word-wrap is most time-consuming.
 

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