Micro Focus QTP (UFT) Forums
Copy Data from Notepad - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Copy Data from Notepad (/Thread-Copy-Data-from-Notepad)



Copy Data from Notepad - jegansurya - 07-03-2012

In my java application we are copy & paste date from notepad to java table.
I want to know how to copy all the data from notepad.


RE: Copy Data from Notepad - ssvali - 07-03-2012

Try this code

Code:
Set fso = CreateObject("Scripting.FileSystemObject")
Set ObjFile = fso.OpenTextFile ("D:\NotePad.txt",1,TRUE)
StrChar = ObjFile.ReadAll
msgbox StrChar



RE: Copy Data from Notepad - jegansurya - 07-04-2012

Hi ssvali,
Your code is not working for me.

My Functionality is below and see attachment for reference.
1) Need to copy all the data from notepad.
2) Select the first row in java table.
3) Paste the data by press "CTLR+V".

Note: Simply want to say means i want to copy & paste data in java table
I don't have excel.


RE: Copy Data from Notepad - Shridevi.Salagare - 07-04-2012

Please try below code -

Code:
Create objFSO = CreateObject("Scripting.FileSystemObject")

Systemutil.Run "Path of the notepad where its stored"

Window("Notepad").WinEditor("Edit").Type micCtrlDwn + "a" + micCtrlUp

Window("Notepad").WinEditor("Edit").Type micCtrlDwn + "C" + micCtrlUp
then go to the pane where you want to paste and do
("Object where you want to paste.")Type micCtrlDwn + "V" + micCtrlUp
Make sure that all the other notepads are closed when you execue this ..As if more notepads are open it will not be able to recognize the object.