Attribute VB_Name = "tm2unicode"

Sub tm2unicode()
'
' tm2unicode Macro
' Macro written 4/18/2004 by Timothy Montler
'   montler@unt.edu
'

' Keep it quiet
    Application.DisplayStatusBar = False
    Application.ScreenUpdating = False

    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Forward = True
    Selection.Find.Wrap = wdFindContinue
    Selection.Find.Format = False
    Selection.Find.MatchCase = True
    Selection.Find.MatchWholeWord = False
    Selection.Find.MatchWildcards = False
    Selection.Find.MatchSoundsLike = False
    Selection.Find.MatchAllWordForms = False
        
    
' Start with the 21 that must precede others to avoid feeding

' barred-l
    With Selection.Find
        .Text = Chr(167)
        .Replacement.Text = ChrW(322)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
' barred-lambda
    With Selection.Find
        .Text = Chr(156)
        .Replacement.Text = ChrW(411)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
' raised-n
    With Selection.Find
        .Text = Chr(228)
        .Replacement.Text = ChrW(8319)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
  
' z-wedge
    With Selection.Find
        .Text = Chr(230)
        .Replacement.Text = ChrW(382)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' (raised-)theta (currently no Unicode superscript theta)
    With Selection.Find
        .Text = Chr(231)
        .Replacement.Text = ChrW(952)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' small-cap-i
    With Selection.Find
        .Text = Chr(232)
        .Replacement.Text = ChrW(618)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' double-slash
    With Selection.Find
        .Text = Chr(233)
        .Replacement.Text = ChrW(8741)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
' alpha
    With Selection.Find
        .Text = Chr(224)
        .Replacement.Text = ChrW(945)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
' rot-m
    With Selection.Find
        .Text = Chr(236)
        .Replacement.Text = ChrW(623)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' raised-h
    With Selection.Find
        .Text = Chr(237)
        .Replacement.Text = ChrW(688)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
' rot-script-a
    With Selection.Find
        .Text = Chr(241)
        .Replacement.Text = ChrW(594)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' fishhook
    With Selection.Find
        .Text = Chr(242)
        .Replacement.Text = ChrW(638)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
' ipa-esh
    With Selection.Find
        .Text = Chr(243)
        .Replacement.Text = ChrW(643)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
' lc-sigma
    With Selection.Find
        .Text = Chr(246)
        .Replacement.Text = ChrW(963)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
' lc-beta
    With Selection.Find
        .Text = Chr(248)
        .Replacement.Text = ChrW(946)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' barred-i
    With Selection.Find
        .Text = Chr(249)
        .Replacement.Text = ChrW(616)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' raised-dot
    With Selection.Find
        .Text = Chr(250)
        .Replacement.Text = ChrW(721)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
' dotless-i
    With Selection.Find
        .Text = Chr(252)
        .Replacement.Text = ChrW(305)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
' uc-sigma
    With Selection.Find
        .Text = Chr(254)
        .Replacement.Text = ChrW(425)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
' o-grave
    With Selection.Find
        .Text = Chr(225)
        .Replacement.Text = ChrW(242)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

    


' For the rest of these the order does not matter.

' pharyngeal
    With Selection.Find
        .Text = Chr(128)
        .Replacement.Text = ChrW(661)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' u-umlaut
    With Selection.Find
        .Text = Chr(129)
        .Replacement.Text = ChrW(252)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' engma
    With Selection.Find
        .Text = Chr(130)
        .Replacement.Text = ChrW(331)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' a-acute
    With Selection.Find
        .Text = Chr(131)
        .Replacement.Text = ChrW(225)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' schwa-acute
    With Selection.Find
        .Text = Chr(132)
        .Replacement.Text = ChrW(601) & ChrW(769)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' schwa-grave
    With Selection.Find
        .Text = Chr(133)
        .Replacement.Text = ChrW(601) & ChrW(768)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' barred-u
    With Selection.Find
        .Text = Chr(134)
        .Replacement.Text = ChrW(649)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' c-cedilla
    With Selection.Find
        .Text = Chr(135)
        .Replacement.Text = ChrW(231)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' e-acute
    With Selection.Find
        .Text = Chr(136)
        .Replacement.Text = ChrW(233)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' ash-grave
    With Selection.Find
        .Text = Chr(137)
        .Replacement.Text = ChrW(230) & ChrW(768)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' smcap-u
    With Selection.Find
        .Text = Chr(138)
        .Replacement.Text = ChrW(138)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' i-acute
    With Selection.Find
        .Text = Chr(139)
        .Replacement.Text = ChrW(237)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' epsilon-grave
    With Selection.Find
        .Text = Chr(140)
        .Replacement.Text = ChrW(603) & ChrW(768)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' phi
    With Selection.Find
        .Text = Chr(141)
        .Replacement.Text = ChrW(632)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' o-slash
    With Selection.Find
        .Text = Chr(142)
        .Replacement.Text = ChrW(248)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' n-tilde
    With Selection.Find
        .Text = Chr(143)
        .Replacement.Text = ChrW(241)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' hook-h
    With Selection.Find
        .Text = Chr(144)
        .Replacement.Text = ChrW(614)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' ash
    With Selection.Find
        .Text = Chr(145)
        .Replacement.Text = ChrW(230)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' thorn
    With Selection.Find
        .Text = Chr(146)
        .Replacement.Text = ChrW(254)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' o-acute
    With Selection.Find
        .Text = Chr(147)
        .Replacement.Text = ChrW(243)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' o-umlaut
    With Selection.Find
        .Text = Chr(148)
        .Replacement.Text = ChrW(246)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' oe
    With Selection.Find
        .Text = Chr(149)
        .Replacement.Text = ChrW(156)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' u-acute
    With Selection.Find
        .Text = Chr(150)
        .Replacement.Text = ChrW(250)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' open-o-acute
    With Selection.Find
        .Text = Chr(151)
        .Replacement.Text = ChrW(596) & ChrW(768)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' a-grave
    With Selection.Find
        .Text = Chr(152)
        .Replacement.Text = ChrW(224)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' e-grave
    With Selection.Find
        .Text = Chr(153)
        .Replacement.Text = ChrW(232)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' ipa-ezh
    With Selection.Find
        .Text = Chr(154)
        .Replacement.Text = ChrW(658)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' glottal-stop
    With Selection.Find
        .Text = Chr(155)
        .Replacement.Text = ChrW(660)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' rot-y
    With Selection.Find
        .Text = Chr(157)
        .Replacement.Text = ChrW(654)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' flip-r
    With Selection.Find
        .Text = Chr(158)
        .Replacement.Text = ChrW(641)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' raised w
    With Selection.Find
        .Text = Chr(159)
        .Replacement.Text = ChrW(695)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' c-wedge
    With Selection.Find
        .Text = Chr(161)
        .Replacement.Text = ChrW(269)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' open-o-grave
    With Selection.Find
        .Text = Chr(162)
        .Replacement.Text = ChrW(596) & ChrW(768)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' (raised-)z (currently no Unicode superscript z)
    With Selection.Find
        .Text = Chr(163)
        .Replacement.Text = ChrW(122)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' scwha
    With Selection.Find
        .Text = Chr(164)
        .Replacement.Text = ChrW(601)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' j-wedge
    With Selection.Find
        .Text = Chr(165)
        .Replacement.Text = ChrW(496)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' epsilon-acute
    With Selection.Find
        .Text = Chr(166)
        .Replacement.Text = ChrW(603) & ChrW(769)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' belted-l
    With Selection.Find
        .Text = Chr(168)
        .Replacement.Text = ChrW(620)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' glottalization
    With Selection.Find
        .Text = Chr(169)
        .Replacement.Text = ChrW(789)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' ash-acute
    With Selection.Find
        .Text = Chr(170)
        .Replacement.Text = ChrW(509)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' a-umlaut
    With Selection.Find
        .Text = Chr(171)
        .Replacement.Text = ChrW(228)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' iota
    With Selection.Find
        .Text = Chr(172)
        .Replacement.Text = ChrW(617)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' s-wedge
    With Selection.Find
        .Text = Chr(173)
        .Replacement.Text = ChrW(353)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' wave-barred-l
    With Selection.Find
        .Text = Chr(174)
        .Replacement.Text = ChrW(619)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' i-grave
    With Selection.Find
        .Text = Chr(175)
        .Replacement.Text = ChrW(236)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' macron
    With Selection.Find
        .Text = Chr(176)
        .Replacement.Text = ChrW(772)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' tilde
    With Selection.Find
        .Text = Chr(177)
        .Replacement.Text = ChrW(771)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' acute
    With Selection.Find
        .Text = Chr(178)
        .Replacement.Text = ChrW(769)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' tilde-acute
    With Selection.Find
        .Text = Chr(179)
        .Replacement.Text = ChrW(771) & ChrW(769)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' grave
    With Selection.Find
        .Text = Chr(180)
        .Replacement.Text = ChrW(768)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' tiled-grave
    With Selection.Find
        .Text = Chr(181)
        .Replacement.Text = ChrW(771) & ChrW(768)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' umlaut
    With Selection.Find
        .Text = Chr(182)
        .Replacement.Text = ChrW(766)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' umlaut-acute
    With Selection.Find
        .Text = Chr(183)
        .Replacement.Text = ChrW(766) & ChrW(769)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' sub-dot
    With Selection.Find
        .Text = Chr(184)
        .Replacement.Text = ChrW(803)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' over-dot
    With Selection.Find
        .Text = Chr(185)
        .Replacement.Text = ChrW(775)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' circumflex
    With Selection.Find
        .Text = Chr(186)
        .Replacement.Text = ChrW(770)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' sub-inv-breve
    With Selection.Find
        .Text = Chr(187)
        .Replacement.Text = ChrW(815)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' breve
    With Selection.Find
        .Text = Chr(188)
        .Replacement.Text = ChrW(774)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' sub-ring
    With Selection.Find
        .Text = Chr(189)
        .Replacement.Text = ChrW(805)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' over-ring
    With Selection.Find
        .Text = Chr(190)
        .Replacement.Text = ChrW(778)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' sub-vert-line
    With Selection.Find
        .Text = Chr(191)
        .Replacement.Text = ChrW(716)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' ash
    With Selection.Find
        .Text = Chr(192)
        .Replacement.Text = ChrW(230)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' u-acute
    With Selection.Find
        .Text = Chr(193)
        .Replacement.Text = ChrW(250)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' open-o-grave
    With Selection.Find
        .Text = Chr(194)
        .Replacement.Text = ChrW(596) & ChrW(769)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' x-subdot
    With Selection.Find
        .Text = Chr(195)
        .Replacement.Text = ChrW(120) & ChrW(803)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' schwa
    With Selection.Find
        .Text = Chr(196)
        .Replacement.Text = ChrW(601)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' left-finger
    With Selection.Find
        .Text = Chr(197)
        .Replacement.Text = ChrW(9758)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' not-equal
    With Selection.Find
        .Text = Chr(198)
        .Replacement.Text = ChrW(8800)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' right-arrow
    With Selection.Find
        .Text = Chr(199)
        .Replacement.Text = ChrW(8594)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' wedge
    With Selection.Find
        .Text = Chr(200)
        .Replacement.Text = ChrW(780)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' cedilla
    With Selection.Find
        .Text = Chr(201)
        .Replacement.Text = ChrW(807)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' nasal-hook
    With Selection.Find
        .Text = Chr(202)
        .Replacement.Text = ChrW(808)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' sub-hook
    With Selection.Find
        .Text = Chr(203)
        .Replacement.Text = ChrW(802)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' sub-hook
    With Selection.Find
        .Text = Chr(204)
        .Replacement.Text = ChrW(802)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' breve-acute
    With Selection.Find
        .Text = Chr(205)
        .Replacement.Text = ChrW(774) & ChrW(769)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' breve-grave
    With Selection.Find
        .Text = Chr(206)
        .Replacement.Text = ChrW(774) & ChrW(768)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' breve-tilde
    With Selection.Find
        .Text = Chr(207)
        .Replacement.Text = ChrW(774) & ChrW(771)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' sub-tilde
    With Selection.Find
        .Text = Chr(208)
        .Replacement.Text = ChrW(816)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' sub-umlaut
    With Selection.Find
        .Text = Chr(209)
        .Replacement.Text = ChrW(804)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' macron-acute
    With Selection.Find
        .Text = Chr(210)
        .Replacement.Text = ChrW(772) & ChrW(769)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' macron-grave
    With Selection.Find
        .Text = Chr(211)
        .Replacement.Text = ChrW(772) & ChrW(768)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' length-colon
    With Selection.Find
        .Text = Chr(212)
        .Replacement.Text = ChrW(720)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' sub-dental
    With Selection.Find
        .Text = Chr(214)
        .Replacement.Text = ChrW(810)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' sub-inv-breve
    With Selection.Find
        .Text = Chr(215)
        .Replacement.Text = ChrW(813)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' sub-wedge
    With Selection.Find
        .Text = Chr(216)
        .Replacement.Text = ChrW(812)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' a-macron
    With Selection.Find
        .Text = Chr(217)
        .Replacement.Text = ChrW(257)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' e-macron
    With Selection.Find
        .Text = Chr(218)
        .Replacement.Text = ChrW(275)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' i-macron
    With Selection.Find
        .Text = Chr(219)
        .Replacement.Text = ChrW(299)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' o-macron
    With Selection.Find
        .Text = Chr(220)
        .Replacement.Text = ChrW(333)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' u-macron
    With Selection.Find
        .Text = Chr(221)
        .Replacement.Text = ChrW(363)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' ash-macron
    With Selection.Find
        .Text = Chr(222)
        .Replacement.Text = ChrW(483)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' epsilon-acute
    With Selection.Find
        .Text = Chr(223)
        .Replacement.Text = ChrW(603) & ChrW(769)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' u-grave
    With Selection.Find
        .Text = Chr(226)
        .Replacement.Text = ChrW(249)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' gamma
    With Selection.Find
        .Text = Chr(227)
        .Replacement.Text = ChrW(947)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' theta
    With Selection.Find
        .Text = Chr(229)
        .Replacement.Text = ChrW(952)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' rot-v
    With Selection.Find
        .Text = Chr(234)
        .Replacement.Text = ChrW(652)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' edh
    With Selection.Find
        .Text = Chr(235)
        .Replacement.Text = ChrW(240)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' epsilon
    With Selection.Find
        .Text = Chr(238)
        .Replacement.Text = ChrW(603)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' open-o
    With Selection.Find
        .Text = Chr(239)
        .Replacement.Text = ChrW(596)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' script-a
    With Selection.Find
        .Text = Chr(240)
        .Replacement.Text = ChrW(593)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' section
    With Selection.Find
        .Text = Chr(244)
        .Replacement.Text = ChrW(167)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' h-sub-dot
    With Selection.Find
        .Text = Chr(245)
        .Replacement.Text = ChrW(7717)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' swung-dash
    With Selection.Find
        .Text = Chr(247)
        .Replacement.Text = ChrW(8764)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' root
    With Selection.Find
        .Text = Chr(251)
        .Replacement.Text = ChrW(8730)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

' lig2underline
    With Selection.Find
        .Text = Chr(253)
        .Replacement.Text = ChrW(95)
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
    
Application.ScreenUpdating = True
Application.DisplayStatusBar = True
    
Reply = MsgBox("Finished character replacement." & Chr(10) & _
                "Select a Unicode font to view the file.", 0, "TM2UNICODE")
    
End Sub

