I am using following where it replaces entities like < with <, > with >, &alpha wth α but i need replace "<", ">", "@"......with unique codes like < , > ..........
Public Function QuickRead(FName As String) As Variant
Dim i As Integer
Dim res As String
Dim l As Long
Dim line As Variant
i = FreeFile
l = FileLen(FName)
res = Space(l)
Open FName For Binary Access Read As #i
Get #i, , res
Close i
'split the file with vbcrlf
QuickRead = Split(res, vbCrLf)
End Function
Sub Entity()
Dim strFilePathName As String: strFilePathName = "sample.txt"
Dim strFileLine As String
Dim line As Variant
Dim strng As Variant
Dim i As Long
Dim j As Long
Dim k As Long
line = QuickRead(strFilePathName)
For i = 0 To UBound(line)
strng = Split(line(i), "=")
For j = 0 To UBound(strng)
With Selection.Find
.Text = strng(0)
.Replacement.Text = ChrW(strng(1))
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
Next
Next
End Sub
here all entities are stored in text file which are read as array
thanks in advance