![]() |
|
#2
|
||||
|
||||
|
The problem you're having is mainly due to each 'word' including the trailing space, if any. Even so, there's a simpler way:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim StrOut As String
With ActiveDocument.Range
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "<[!^13 ]@[aeiouy] [aeiouy][! ]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchWildcards = True
.Execute
End With
Do While .Find.Found
StrOut = StrOut & vbCr & .Text
.Collapse wdCollapseEnd
.Find.Execute
Loop
End With
ActiveDocument.Range.InsertAfter vbCr & Chr(12) & "Hiatus List" & StrOut
Application.ScreenUpdating = True
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ActiveDocument.ContentControls(ID) not working | Tejas.T | Word VBA | 3 | 03-09-2015 06:50 PM |
How show characters instead words (status bar)
|
BrunoChirelli | Word | 2 | 02-19-2015 12:03 PM |
| wordapp.ActiveDocument.SaveAs Not Working | KSReynolds | Mail Merge | 1 | 07-18-2014 04:03 PM |
Color words ending with special characters
|
Singh_Edm | Word | 2 | 01-20-2014 12:51 AM |
Array into ComboBox + Macro-Text into ActiveDocument
|
Vivi | Word VBA | 1 | 01-27-2010 07:03 AM |