I am trying to replace specific text in the first line of an image (I manually opened the image using notepad++ and modify that text)
Using the following code raises an error (input past end of file)
Code: Select all
Sub Test()
Dim sPath As String, sCont As String, f As Integer
sPath = Environ("USERPROFILE") & "\Desktop\Sample.jpg"
f = FreeFile
Open sPath For Input As f
sCont = Input(LOF(f), f)
Close f
sCont = Replace(sCont, "ICC_PROFILE", "ICC_PROFILX")
f = FreeFile
Open sPath For Output As f
Print #f, sCont
Close f
End Sub