VB5 code, may not work without a few changes:
Dim FileText As String 'Know this worksOpen MyFile For Binary As 1 'Know this worksFileText = Space$(LOF(1)) 'Creates a string the same length as the fileGet #1, , FileText 'Should workCloseDox = InStr(x + 1, FileText, OldText) 'Know this worksIf x 0 ThenFileText = Left$(FileText, x - 1) & NewText & Right$(FileText, Len(FileText) - (x + Len(OldText) - 1)) 'Should workFileChanged = 1ElseExit DoEnd IfLoopIf FileChanged = 1 ThenOpen MyFile For OutPut As 1 'Know this worksClose 'Know this worksOpen MyFile For Binary As 1 'Know this worksPut #1, , FileText 'Should workCloseEnd If
Hope this helps!
It looks like you're new here. If you want to get involved, click one of these buttons!