![]() |
|
#13
|
|||
|
|||
|
This seems to work:
Code:
Sub FormatAuthorNamesInSmallCaps()
Dim rng As range
Dim authorNames As Variant
Application.ScreenUpdating = False
Set rng = ActiveDocument.range
'Liste der Autorennamen
authorNames = Array("Ackermann", "Angermann", _
"Andersen", "Atzeni", "Baecker", "Ortmann", _
"Zamoyski", "Ziegler", "Wurzbach", "Zittel", _
"Zürcher", "Zytphen-Adeler")
For i = 0 To UBound(authorNames)
With rng.Find
.ClearFormatting
.Replacement.ClearFormatting
.text = authorNames(i)
.Forward = True
.Wrap = wdFindStop
.MatchWholeWord = True
While .Execute
rng.Font.Italic = True
rng.Font.SmallCaps = True
rng.Collapse wdCollapseEnd
Wend
End With
Next i
Application.ScreenUpdating = True
End Sub
|
| Tags |
| chatgpt, names, vba |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Printing list of names in a publisher or word document
|
Marcia | Word | 2 | 09-27-2018 01:28 AM |
| How to find CAPITALIZED names and change them into small caps | dylan.ve | Word VBA | 5 | 02-25-2016 03:15 PM |
| Find and replace inside strings containing various names | audioman | Word VBA | 4 | 03-25-2014 11:19 AM |
Word Form / VBA Solution for Formatted Document
|
elmousa68 | Word VBA | 5 | 10-15-2013 05:10 PM |
| find author names in text | anil3b2 | Word | 0 | 08-02-2010 04:12 AM |