Forum Discussion
AlexanderM
15 years agoStaff
Hi,
The problem is not related to the P2.htm file's size.
All three files use different character encoding systems: the a1.htm file has the ANSI encoding, the P2.htm file has the UTF-16 encoding, and the p2_2.htm file has the UTF-8 encoding. So, try using the modified routine:
Sub Comp_Refile_modified()
Dim file1, fileText1, newText1
' Reads the first text file
Set file1 = aqFile.OpenTextFile("C:\Temp\p2.htm", aqFile.faReadWrite, aqFile.ctUnicode)
fileText1 = file1.ReadAll
Call Log.Message(fileText1)
newText1 = Replace(fileText1, "#FFFF99", "#FFFFFF")
Call aqFile.WriteToTextFile("C:\Temp\p2_2.htm", newText1, aqFile.ctUTF8, Yes)
Call file1.Close
End Sub