If Not UCase(OrgText.Text) = UCase(NewText.Text) And Not OrgText.Text = "" Then
If MsgBox("Are you sure ?" + vbCrLf + vbCrLf + "* if you replaced text for all sentences, you may damage the program !" + vbCrLf + vbCrLf, vbYesNo + vbQuestion, "Replace") = vbYes Then
LoadingExtAll.Visible = True
For I = 0 To ExtractedFilesSentences.ListCount - 1
' open old text
Open App.Path + "\Temp\" + ExtractedFilesSentences.List(I) For Input As #1
Input #1, X
Close #1
' replace
Do While InStr(1, UCase(X), UCase(OrgText.Text)) > 0
n = InStr(1, UCase(X), UCase(OrgText.Text))
X = Left(X, n - 1) + NewText.Text + Right(X, Len(X) - n + 1 - Len(OrgText.Text))
Loop
' save new text
Open App.Path + "\Temp\" + ExtractedFilesSentences.List(I) For Binary As #2
If MsgBox("Are you sure ?" + vbCrLf + vbCrLf + "* New image will be loaded from C:\Exported." + Right(ExtractedFiles.List(ExtractedFiles.ListIndex), 3) + vbCrLf + vbCrLf, vbYesNo + vbQuestion, "Replace") = vbYes Then
Open "C:\Exported." + Right(ExtractedFiles.List(ExtractedFiles.ListIndex), 3) For Input As #1
Ln1 = LOF(1)
Close #1
Open App.Path + "\Temp\" + ExtractedFiles.List(ExtractedFiles.ListIndex) For Input As #2