View Single Post
 
Old 02-01-2019, 04:52 AM
Guessed's Avatar
Guessed Guessed is online now Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,988
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I haven't got your document so I'm not able to test but this is a tidier version of what you had working. I'm still not sure what the loop through the Para's is supposed to achieve but if you are happy with it then that should be fine.
Code:
Sub TopiaFormat()
  Dim Para As Paragraph, Rng As Range, HLnk As Hyperlink
  
  ActiveDocument.ConvertNumbersToText

  For Each Para In ActiveDocument.Range.Paragraphs
    With Para.Range
      If .Text Like "?" & vbTab & "*" Then
        Set Rng = .Duplicate
        With Rng
          .End = .Start + 2
          .Text = Chr(149) & vbTab
        End With
      End If
    End With
  Next

  With Selection.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Wrap = wdFindContinue
    .Forward = True
    
    .Text = "^0233"
    .Replacement.Text = " - "
    .Execute Replace:=wdReplaceAll
    
    .Text = "ï"
    .Replacement.Text = "[*]"
    .Execute Replace:=wdReplaceAll
    
    .Text = "[*]^w"
    .Execute Replace:=wdReplaceAll
    
    .Text = "^p^p"
    .Replacement.Text = "^p^p^p"
    .Execute Replace:=wdReplaceAll
  End With

  For Each HLnk In ActiveDocument.Hyperlinks
    HLnk.Range.InsertAfter "]"
    HLnk.Range.InsertBefore "[>" & HLnk.Address & "|"
    HLnk.Delete
  Next
  
  ActiveDocument.Range.ClearFormatting
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote