WordPad Automation

  • Thread starter Thread starter Ding
  • Start date Start date
D

Ding

Does anybody have sample VBA code to open a file with Wordpad and execute a
"Search & Replace"?

Thank you!
 
Why do you feel you need to use NotePad?

If it is a text file, you can open it with Access read it into a textbox,
then use the Replace function to make automatic replacements, or use the
instr( ) function to find the next occurance of the string and highlight it.

Then, when you are done, you can write it back to the text file.

Take a look at the Open, Input, Print, and Write functions and statement in
Help to get some ideas on how to do this.
 
There is no automation for WordPad: you would have to use Send Keys to
send keystrokes to WordPad to do "Search & Replace".

WordPad is a shell for the RichText object and the Text Services Framework.

The RichText object can be controlled and automated: that is how WordPad
works. You can insert a RichText object on to one of your forms if you want
to do that.

(david)
 
Back
Top