Public Function GetMTextUnformatString(MTextString As String) As String
Dim s As String
Dim RE As Object
Set RE = ThisDrawing.Application.GetInterfaceObject("VBscript.RegExp")
RE.IgnoreCase = True
RE.Globa = True
s = MTextString
RE.pattern = "\\\"
s = RE.Replace(s, Chr(1))
RE.pattern = "\\{"
s = RE.Replace(s, Chr(2))
RE.pattern = "\\}"
s = RE.Replace(s, Chr(3))
RE.pattern = "\\pi(.[^;]*);"
s = RE.Replace(s, "")
RE.pattern = "\\pt(.[^;]*);"
s = RE.Replace(s, "")
RE.pattern = "\\s(.[^;]*)(\^|#|\\)(.[^;]*);"
s = RE.Replace(s, "$1$3")
RE.pattern = "(\\F|\\C|\\H|\\T|\\Q|\\W|\\A)(.[^;];"
s = RE.Replace(s, "")