How to find and replace a string in a doc file?

atari

New Member
Licensed User
Hi all!

I'd like to ask for help, my problem is the following:
I have a doc or rtf file and I have to find a string in the file and replace it for another stirng automaticly without any editor.
For example by pressing a key....
How should I do this?
Any good idea I would appreciate!


Regards,
Atari
 
Attached is a raw sample written on the fly.
Textbox1.Text replaces the "RecordToBeDeleted" in the txt.txt file.
It's up to you to customize the sample....at least it works.

No doubt some grands here can suggest a better solution
 

mjcoon

Well-Known Member
Licensed User
For large files it is better to read the file one row at a time, update it if necessary and write it to a new file.

But then you need to know if the string to be replaced could span more than one line...

Mike.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…