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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying Between different Apps!

Status
Not open for further replies.

Taff07

MIS
Jul 18, 2001
160
GB
Hi,

Hopefully somebody can provide a solution to my dilemma.

I have two different applications running, one is notepad and one is a specialized program. My aim is to copy data from the teh specialized program into notepad to use at a later date.

I am using the SendKeys command to basically cycle through the pages and copy the whole page and paste it into Notepad. The problem I am facing is getting the code to wait while the system responds to a key press command. Does anyone know how to get around this problem?

Thanks

Ian
 
Ian,

It would be useful to know why you are trying to do this as there might be other ways to achieve what you are trying to do without having to have notepad running.

Chris Dukes
 
If you are sending Ctrl-C(copy) Ctrl-V(paste) you may need to use DoEvents or The Sleep API Call. You could also just create a File System Object as A text file using the desired text and just open notepad at a later point.
 
I agree with foada. It would be far easier to create a file "C:\tempfile01adsfr.txt" then Shell "Notepad.exe c:\tempfile01adsfr.txt"

Unless there is a specific reason you can't do that...

Kevin
 
Thanks for the replies,

I don`t have to use notepad, it`s just the program thats currently being used to do the process manually.

If I go a bit more in detail it may give a better picture.

The process as it stnads at the moment is that the user opens up the Specialized(Main) software. This is basically a gateway into a reporting system which has generated reports overnight. This is a completely Keyt based application accept for the general window functions of highlighting, main menubar for preferences etc. This means the only way to navigate through the system is via keypresses. The problem I have encountered is that the system has a slight lag in responding to the keypress and loading the next page. What I need is something that( I knw I`m probably asking a lot) can tell the code that the application has responded to the keypress to change a page and finished loading it beofre moving to the copy paste sections. At present I have incorporated a very basic timeloop to give a long enough pause between commands being sent to the application. The problem I know with this is both that different machines will operate and different rates and that the application can slow down a little at times.

hope this gives a clearer picture.

Thanks

Ian
 
Sorry missed out what is done to the file after it is created :)

I then import the file into access using a fixed width specification, where i proceed to filter out any unwanted lines using particular fields of the data.

Thanks again

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top