Can styles do what I want?

P

PhilD

I produce part of a magazine. This needs certain terms and words to be
italicised or boldened as per the house style. The affected terms are
always the first sentence of a paragraph, plus certain instances within
the text in the remainder of the paragraph.

Can styles be made to do this automatically? I suspect that the answer
will either be "no", or will involve some sort of macro (my confidence
= 0, don't know how to put these in).

Thanks,

PhilD
 
C

Clive Huggan

The short ill-considered answer is No and Yes.

On existing documents, if you want to keep out of writing or recording
macros, consider using the full power of find and replace.

On new documents, you might get away with autocorrect.
e.g. make "drm" an autocorrect entry for /DRM/ (with character style of
emphasis). Check the formatted box. Paste the replace with one you
prepared earlier in the document and copied to the clipboard. You can
avoid the last step if you leave the sample selected before entering
tools autocorrect...
It looks convenient for one at a time, than the brain damaged modal
dialog box won't let you go back to the document without closing it
first!!

Hello Phil,

Just a couple of thoughts after reading Elliott's comments: The problem with
styles in this context is that you want to apply italics (the "emphasis"
style Elliott refers to) or bold ('strong' style in Word's defaults) to only
part of a paragraph, so paragraph styles are out and you need to apply
character styles, for which you always have to select where you want to
apply the styles.

In similar instances (first sentence of paragraphs), I simply hold down the
Command key and click in the sentence before applying an italic style. I do
this manually even in long documents, but if I were doing it very often I
would indeed use a macro that would select and italicise as soon as I
clicked in a sentence. Post back if you need help to make such a macro and
someone is likely to help (I take ages to do macros, so it won't be me!).

I'm assuming you are modifying text produced by others. If you were
initiating text, it would be easy to insert an AutoText item that had, say,
an italicized full stop followed by a roman space. Typing before the full
stop would be in italics; after the space would be roman.

I don't have any ideas re italicizing text other than the first sentence ­
sorry! Long ago, Word used to have keystrokes to select certain word
groupings -- e.g. the entire word where you had clicked, then successive
words to the left -- but now that the application is based on Windows
positives and negatives, they aren't available (other than double-clicking
to select a word).

If you don't have a full grasp of paragraph styles vs character styles, take
a look at the articles 'How styles are applied', 'When to use styles and
when to format directly' and 'Paragraph styles and character styles --
what's the difference?' in "Bend Word to Your Will", available as a free
download from the Word MVPs' website
(http://word.mvps.org/MacWordNew/Bend/BendWord.htm).

Cheers,

Clive Huggan
Canberra, Australia
(My time zone is 5-11 hours different from the US and Europe, so my
follow-on responses to those regions can be delayed)
============================================================
* A SUGGESTION -- WAIT FOR CONSIDERED ADVICE: If you post a question, keep
re-visiting the newsgroup for several days after the first response comes
in. Sometimes it takes a few responses before the best or complete solution
is proposed; sometimes you'll be asked for further information so that a
better answer can be provided. Good tips about getting the best out of
posting are at http://word.mvps.org/FindHelp/Posting.htm (if you use Safari
you may see a blank page and have to hit the circular arrow icon -- "Reload
the current page" -- a few times).

============================================================
 
D

Daiya Mitchell

A slightly different take, but still Yes and no.

Styles carry certain formatting, but they don't apply themselves
automatically like that.

You could use Find and Replace to automatically apply the styles, like
Elliot said.

If the "certain instances" are always the same words, you can Find and
Replace the word to apply the style. In this case, it sounds like you would
want a character style consisting of Default Paragraph Font + bold, or
somesuch.
For more re Default Paragraph Font, see here:
http://word.mvps.org/faqs/customization/DefParaFont.htm
(hit reload a few times in Safari, or use a different browser)

To F&R styles, you need to click the blue triangle to expand the Find dialog
and use the Format menu in the Find dialog to format the box with certain
styles.

It's pretty easy to record a macro that essentially saves a Find and Replace
so that you can repeat it over and over again, or that runs 6 different F&Rs
in one click. Don't be afraid of venturing at least that far. :) and we'll
help if necessary.

The first sentence thing is a little bit trickier.

A Find and Replace could probably apply a certain style to all text between
a paragraph break and the first period it comes to. That one's a little
tricky (and I don't know how to do it), and might require a macro or
applescript, because "beginning of paragraph" and "select this sentence" are
not options in the dialog box for Find and Replace, but ought to be
accessible via macros or applescript.

Unfortunately, I think the scripting gurus who hang out here might be at
MacWorld right now. But can you give an example of a typical paragraph?

Also, what OS and Word?
 
P

PhilD

Thanks to all respondents, especially for all that typing on what it
appears is a complex subject. I use Office 2004 in OS 10.4.3 (though
will probably go to 10.4.4 soon, though I doubt that will make any
difference).


Daiya said:
You could use Find and Replace to automatically apply the styles, like
Elliot said.
If the "certain instances" are always the same words, you can Find and
Replace the word to apply the style. In this case, it sounds like you would
want a character style consisting of Default Paragraph Font + bold, or
somesuch.

The "certain instances" are things like newspaper and magazine names
where they are quoted (as in "XYZ newspaper reports that...", "such and
such will happen, according to XYZ magazine", that kind of thing).

I like the autocorrect idea suggested by Elliott Roper for fresh text,
and find/replace for stuff sent by others and copied in, but I'll have
a look at the various links suggested, too.

(By the way, why do you need to "hit reload a few times in Safari".
Why doesn't it work first time?)
It's pretty easy to record a macro that essentially saves a Find and Replace
so that you can repeat it over and over again, or that runs 6 different F&Rs
in one click. Don't be afraid of venturing at least that far. :) and we'll
help if necessary.

I really must explore macros more. When I get the time...

Thanks,

PhilD
 
M

mstokowski

PhilD said:
I produce part of a magazine. This needs certain terms and words to be
italicised or boldened as per the house style. The affected terms are
always the first sentence of a paragraph, plus certain instances within
the text in the remainder of the paragraph.

Word will not do this without a macro, but more advanced page layout
software will. Adobe Indesign includes a feature called "Nested Styles"
that performs the the first part of your requirement, italicizing (or
bolding) the first sentence of a paragraph.
Can styles be made to do this automatically? I suspect that the answer
will either be "no", or will involve some sort of macro (my confidence
= 0, don't know how to put these in).

In Word, a macro is the best solution for a long document with myriad
terms. You would simply run it whenever you add material, or when you
are ready to add formatting, and it should be safe to run it over
material that is already formatted. Below is the pseudo-code for the
macro that I believe will solve your problem. If it is a solution, it
would not be too hard to implement:

1 Create a variable called FirstSentence
2 Start at the Beginning of the Document
3 Find a Paragraph break
4 Select to the first sentence of the paragraph
5 Set the variable, FirstSentence, to the selected material, minus the
period (This will be used to find other material in the paragraph that
needs to be italicized)
6 Apply the "Term" Character Style to the selected sentence, where Term
is the name of your italicized character style
7 Within the paragraph, search for FirstSentence (this is a nested
search) and apply Term to each occurence
8 Find the next Paragraph and repeat steps 4 through 7
9 Repeat all steps until the end of the document is reached
 

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