Micro Focus QTP (UFT) Forums

Full Version: Copy Data from Notepad
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
Try this code

Code:
Set fso = CreateObject("Scripting.FileSystemObject")
Set ObjFile = fso.OpenTextFile ("D:\NotePad.txt",1,TRUE)
StrChar = ObjFile.ReadAll
msgbox StrChar
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.
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.