![]() |
|
#4
|
||||
|
||||
|
Try the following code revision:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim i As Long, j As Long, k As Long, para As Paragraph, Fmt As ParagraphFormat, HPos As Single
With ActiveDocument
.DefaultTabStop = 0
j = .Paragraphs(1).TabStops.Count
For i = 1 To .Paragraphs.Count
For k = 1 To j
If .Paragraphs(i).Range.Characters.Last.Information(wdHorizontalPositionRelativeToTextBoundary) < _
.Paragraphs(1).TabStops(k).Position Then .Paragraphs(i).Range.Characters.Last.InsertBefore vbTab
Next
While (Len(.Paragraphs(i).Range.Text) - Len(Replace(.Paragraphs(i).Range.Text, vbTab, ""))) < j
.Paragraphs(i).Range.InsertBefore vbTab
Wend
Next
.Range.ParagraphFormat = .Paragraphs(1).Range.ParagraphFormat
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
| Tags |
| columns, search/replace, tabulator |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Advanced search and replace for bullet points | TishyMouse | Word | 5 | 02-17-2012 06:32 AM |
| Any wildcards search and replace in Powerpoint 2010? | tinfanide | PowerPoint | 0 | 09-10-2011 02:17 AM |
WORD: Rtf and search-replace (regexp/fonts)
|
seteshpl | Word | 1 | 09-06-2011 01:35 AM |
| Search Replace Copy | dblack7211 | Word | 0 | 05-05-2010 01:19 PM |
| Search and Replace - Clear Search box | JostClan | Word | 1 | 05-04-2010 08:46 PM |