![]() |
#9
|
||||
|
||||
![]()
The problem appears to be related to the presence of fields in your content. Try:
Code:
Sub Demo() Application.ScreenUpdating = False With ActiveDocument.Range With .Find .ClearFormatting .Replacement.ClearFormatting .Text = "^t" .Forward = True .Wrap = wdFindStop End With Do While .Find.Execute = True .Start = .Paragraphs(1).Range.Start If Len(.Text) - Len(Replace(.Text, vbTab, "")) > 1 Then .Characters.Last.Text = " " .Collapse wdCollapseEnd Loop End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
LuisXVI | Word VBA | 4 | 11-12-2018 03:12 PM |
![]() |
staicumihai | Word VBA | 4 | 11-07-2018 01:14 AM |
![]() |
rsrasc | Word VBA | 4 | 04-18-2018 11:32 PM |
Tabs set along left edge of page; how to delete | ginny | Word | 4 | 03-21-2018 08:07 PM |
![]() |
AlexanderJohnWilley | Word VBA | 7 | 11-08-2012 10:15 AM |