#1
|
|||
|
|||
Using wildcards to italicize magazine/book titles
Hello,
I have a loooong list of book/magazine titles--well over three or four thousand titles-- and I would need to find a way to italicize those titles. The listing is something like this: 46. First Magazine 1.8, April 1960 47. Second Magazine 36, April 1960 1144. First Book, September 1981 1145. Second Book, September 1981 I'm a complete beginner re. the use of wildcards. If I use the following wildcard, I'm able to get to the first letter of the book/magazine title, but I don't know how to select the full title, not just the first letter: [0-9]. [a-zA-Z] Titles are always preceded by a number, which is followed by a period, and then comes the magazine/book title, always followed by a comma or a number. The only variable which is unknown here is the length of the title. Is there any wildcard that would allow me to select the full title given there's always a comma or a number after the title? There's a lot of additional info in each entry, so I can't export this to Excel, where it should be fairly easy to do. Thanks!! |
#2
|
|||
|
|||
Try the following wildcard Find/Replace:
Find=[0-9]{1,}.*^13 Replace=^& with italic format |
#3
|
||||
|
||||
You really need a macro for this:
Code:
Sub Demo() Application.ScreenUpdating = False Dim i As Long With ActiveDocument.Range With .Find .ClearFormatting .Replacement.ClearFormatting .Text = "[0-9].[ a-zA-Z]@[,0-9]" .Replacement.Text = "" .Forward = True .Wrap = wdFindStop .Format = False .MatchWildcards = True End With Do While .Find.Execute i = i + 1 .Start = .Start + 3 .End = .End - 1 .Font.Italic = True .Start = .Paragraphs.Last.Range.End Loop End With Application.ScreenUpdating = True MsgBox i & " titles formatted." End Sub For Mac macro installation & usage instructions, see: Word:mac - Install a Macro
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
||||
|
||||
That formats everything, not just the titles.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Quote:
For some reason, the comma in {1,} does not seem to be valid. If a remove that comma, the Find What text selects the complete line, not only the text. |
#6
|
||||
|
||||
Quote:
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
Thanks, that did the trick indeed. But as you pointed out, that formats the complete line, not just the titles.
I tried your macro and it seems to work when the title has one word only; if there are two words, then that entry is skipped. Many books/magazines have several words in their titles. Is it possible to italicize all title words? |
#8
|
||||
|
||||
Quote:
46. First Magazine 1.8, April 1960 47. Second Magazine 36, April 1960 1144. First Book, September 1981 1145. Second Book, September 1981 Which is consistent with your description in post #1:
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#9
|
|||
|
|||
Thanks! You are, of course, right! Thing is, I tried the macro using some actual titles, and some of them were not properly formatted. Taking a close look at them I noticed there were apostrophes or exclamation points in them. For some reason, the macro skips those titles, as in:
46. First Magazine’s Entry 1.8, April 1960 47. Second Magazine 36, April 1960 1144. First Book, September 1981 1145. Second Book, September 1981 Is there a way for the macro to ignore apostrophes, exclamation points, and so on, so that all titles get italics? There are also some 300 titles that are not followed by a comma or a number, as in: 74. Mindscapes: Poems for the Real World Richard Peck, ed. | Dell Publishing Company: New York, NY | 1972 After running the macro I get this: 74. Mindscapes: Poems for the Real World Richard Peck, ed. | Dell Publishing Company: New York, NY | 1972 The title line is followed by the editor's name in the next line. Both lines are separated by a paragraph break. Could this be used in the macro somehow so that when there's no comma and no number after the title--but there's a paragraph break--then the italics are not used after the title? |
#10
|
||||
|
||||
You could replace:
[ a-zA-Z]@[,0-9] with: [0-9].[!,0-9]@[,0-9^t^l^13] With this expression, the formatting will stop before a comma, number, tab, manual line break or paragraph break - whichever comes first.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#11
|
|||
|
|||
That did work, thanks a lot!
|
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A macro to find interjections from a list and italicize them | FabioDD | Word VBA | 8 | 03-15-2022 06:28 AM |
Magazine-like templates in Word 2019? | dylansmith | Word | 2 | 05-11-2020 03:58 PM |
How can I change the order of book pages of an existing book to left-to-right instead of right to le | Iris12 | Publisher | 0 | 02-06-2018 09:37 AM |
Digital Magazine Publications! | epublisherWorld1 | Publisher | 0 | 08-28-2017 03:49 AM |
magazine column style | Nasser | Word | 4 | 04-21-2010 02:41 PM |