Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

API for NotePad?

Status
Not open for further replies.

CubeE101

Programmer
Nov 19, 2002
1,492
US
Just out of curiosity...

Are there API commands available to conect to a NotePad session, like with word, excel...

Or do the applications require VB/VBA support to do this?

If it is possible, does anyone have an example?

Maybe something like attach to a running session, search and replace strings, print, open/save, etc...

Have Fun, Be Young... Code BASIC
-Josh Stribling
cubee101.gif

 
The point of this is...
We have a PDM that is set up where:
When you can double click a file...
It checks it out onto your hard drive, and opens it with NotePad...

I wanted to make a program that would connect to NotePad in the same way as with Word, and use a find and replace method to automatically update the file...

say if we had a reference in a file that is 12345 and it needs to be 67890 the whole document would be updated, saved, and checked back in...

I Could (and have previously) make a NotePad clone in vb to do this... But, then I would have to Make a Default Association with .TXT to my program, and I really don't want to do that (again), due to some issues with other programs...

I was just wanting to connect to an existing (MicroSoft) NotePad session, I did not think it was possible...

Thanks

Have Fun, Be Young... Code BASIC
-Josh Stribling
cubee101.gif

 
It is possible through some windowing API in user32, but I wonder why you really want Notepad to do this job?

If it is only a matter of find and replace then you can do it even more efficiently and easily alone with VB.
 
is it possible to grab the text from the NotePad window,
and store it in a string in VB,
then use Replace to update the text...
Then put the String back into the NotePad Session?

I could use VB... But I want to leave NotePad as the Default .txt viewer/editor.

I did have it set up with Word and updated it via a macro.
Then it started getting errors, and sometimes it worked and sometimes it didn't (opening in Word not the macro, the macro worked great)... The PDM was designed for Unix, so it is kind of flakey... the only thing it is guarenteed to work with is NotePad...

Have Fun, Be Young... Code BASIC
-Josh Stribling
cubee101.gif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top