![]() |
#2
|
||||
|
||||
![]()
Try running the following macro from the document you want to convert.
Code:
Sub EgyptReformatter() Application.ScreenUpdating = False Dim FRDoc As Document, FRList, j As Long Set FRDoc = Documents.Open("C:\Users\" & Environ("UserName") & "\Documents\Egypt List.txt", _ ReadOnly:=True, Addtorecentfiles:=False, Visible:=False) FRList = FRDoc.Range.Text FRDoc.Close False: Set FRDoc = Nothing With ActiveDocument.Range.Find .ClearFormatting .Replacement.ClearFormatting .MatchWholeWord = True .MatchCase = True For j = 0 To UBound(Split(FRList, vbCr)) - 1 If InStr(FRList, vbTab & vbTab) > 0 Then If Split(Split(FRList, vbCr)(j), vbTab)(6) > 0 Then .Text = Split(Split(FRList, vbCr)(j), vbTab)(0) .Replacement.Text = Split(Split(FRList, vbCr)(j), vbTab)(3) .Execute Replace:=wdReplaceAll DoEvents End If End If Next End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
paulkaye | Word | 6 | 08-20-2015 02:36 AM |
![]() |
markus staubmann | Word | 3 | 03-28-2012 05:23 AM |
![]() |
nrogers64 | Outlook | 1 | 09-17-2010 01:35 AM |
![]() |
Rose44 | Excel | 2 | 08-09-2009 09:05 PM |
Having some formatting issues after converting PDF to .doc | amf25 | Word | 1 | 06-05-2009 02:05 PM |