5 pts.
 how to fetch data from notepad in vb6?
just wanna know if there are ways to retrieve data from notepad and use it in my v6 program.

Software/Hardware used:
ASKED: May 17, 2008  1:38 AM
UPDATED: May 19, 2008  6:57 PM

Answer Wiki:
I don't know if VBA has specific hooks for Notepad, but Notepad docs are just plain text, which is fairly easy to retrieve in VBA. Microsoft has a page on using <a href="http://msdn.microsoft.com/en-us/library/czxefwt8(VS.85).aspx">FileSystemObject to open text files</a> that contains instructions and sample code that will probably set you on your path. HTH. Hi Morfs, Same as Yuval I don't know if Notepad exports an object model. May be you can find it in the references of your VB environment, together with ADO and the like. But if you know the name of the file being edited then you can use the VB "sendkeys" command to make Notepad select all the text and copy it in the clipboard, for example. To do sendkeys you typically need to know the text in the window's bar, for example "thefile.txt - Notepad" (open a fil ein Notepad and take note of the content in the title bar). Notice that the keys you send to the program are language-dependent. For example to select the complete content in an English Windows the command is control-a and in Spanish it's control-e. Also note that there could be more than one window with the same title. Moreover, remember thet VB has a control, a rich text editor, with more or less the same functionality as Notemap, and depending on your app you might host the text edition instead of spawning a Notepad. It it opens bacause the user double-clicks a spacial file type then associate that file type so it will open your app. -- Juan Lanus
Last Wiki Answer Submitted:  May 19, 2008  6:57 pm  by  YuvalShavit   905 pts.
All Answer Wiki Contributors:  YuvalShavit   905 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _