问题描述:

hi i want to replace some characters in special fontname with the orginal characters and use folowing code but in find and replace this line dosent suport my font for finding in persian(arabic)

'.Font.Name = "F2_15_0_09021216" 'thise line dont work...

consider the speed for large doc...

can some body help if this line work then problem of converting pdf to word in arabic will be solved

Private Sub my()

Dim i As Long

Dim Value As String

Dim a As String

Value = Selection.Text

'find all characters used in document

For i = 33 To 65535

If InStr(1, Value, ChrW(i)) > 0 Then

Value = Replace(Value, ChrW(i), "")

'showing the characters in a text box for replace orginal characters

With TextBox1 'i had using this part becuse vba didnt work with my font i dont understand for what so after many try i found this

.Font.Size = 20

.Font.Name = "tahoma"

End With

TextBox1.Text = ChrW(i)

With TextBox1

.Font.Name = "F2_15_0_09021216"

.Font.Size = 20

End With

'get orginal characters

a = InputBox("Insert What You See", " Hi")

'finding characters and replace with orginal characters

With ActiveDocument.Content.Find

.ClearFormatting

.Format = False

'.Font.Name = "F2_15_0_09021216" 'thise line dont work

.Text = ChrW(i)

With .Replacement

.ClearFormatting

.Text = a

End With

'.Font.Name = ""

.Execute Forward:=True, _

Replace:=wdReplaceAll, _

MatchCase:=True, _

MatchWholeWord:=False, _

MatchWildcards:=False

End With

End If

Next i

End Sub

相关阅读:
Top