From text box to Wordpad..

Teessider

New member
Local time
Today, 14:32
Joined
Jun 23, 2006
Messages
6
I have some vba that concatonates a number of variables/fields and puts the resultant value into a text box. Then the user copies and pastes this into wordpad to create a file.

What I would like to do is for the user to click a button and instead of the result being placed into a text box on the form, it would open up wordpad and paste the data into the open document.

I'm guessing this is kinda easy, but can't figure it out myself. Any help will be much appreciated!

Thanks :D
 
Why don't you output the text string into a text file? Search around for there are plenty of threads discussing and answering that topic.
 
ghudson said:
Why don't you output the text string into a text file?
Because that's not what I want to do.

Teessider said:
What I would like to do is for the user to click a button and instead of the result being placed into a text box on the form, it would open up wordpad and paste the data into the open document.

I understand your obsession with people searching first, but I have searched a lot to see if this is possible (i.e. for two days) and haven't found anything, so I was hoping someone would be able to simply tell me if this was possible or not.
 
Teessider, how about this:

You output the text as a textfile, you then open up wordpad with this text file as an argument, which has the effect of opening the file in wordpad. The user does whatever in wordpad with the text, closes it and goes back to access. You then have the user click a button to signify they have finished with wordpad, that then loads the text back in and processes it while deleting the file.

If you want to integrate directly into wordpad, you would probably need to reverse engineer the app to find its interfaces, and then somehow code VBA to take advantage of them.... not exactly easy :)
 
It's all good, found the solution elsewhere...

Simply used Shell to start Wordpad, then used sendkeys to paste in the text.

Wasn't working before for me (which is what was confusing me, as I thought it an easy solution), but by simply pausing the execution of the code for half a second, worked fine!
 

Users who are viewing this thread

Back
Top Bottom