How macro can do printscrn of other application and paste in word

D

discoverer

I am trying to create a macro in word to do a printscreen in toad and paste
it in word. Is it possible to get the events of toad application captured in
word macro.

Thanks
 
T

Tony Jollans

I'm not sure if I can help you but ...

It is possible (I think) with SendKeys to do an Alt+PrintScreen and then
Paste the clipboard into Word but is that what you want?

Or are you trying to drive Toad from Word? And then get records returned to
Word (rather than just an image)?
 
D

discoverer

Tony, I think you have the answer to my question. Actually word should work
as a background process, because whenever I do ALT+printscreen, it should
automatically paste it in word.

One more thing can you tell me how sendkeys can be worked.

Thanks
 
T

Tony Jollans

Easiest way is to look at the help for SendKeys in the VBE, but ..

You can't have Word as a background process - it won't respond to anything
you do in Toad (or Windows). AFAIK there is no way to make a printscreen be
automatically pasted anywhere in any application.
 
T

Tony Jollans

Sorry, Jerry,

It is possible to get round this restriction. I can't remember where I
picked this up from (and I have a feeling there is something odd about it)
but you can use ...

WordBasic.SendKeys "{prtsc}"
 
J

JBNewsGroup

Hi Tony,

Thanks. I totally forgot about checking WordBasic. I wonder why Microsoft
chose to eliminate from VBA functions that WordBasic could handle.

When I did my test I did it under VBA. I am going to try it again with
WordBasic. I have an application in which this would simplify things.

Jerry Bodoff
 
J

JBNewsGroup

Hi Tony,

Thanks.

I totally forgot about WordBasic. I did my test under VBA. I tried doing
this with the WordBasic version and it works great. I wonder why Microsoft
eliminated some WordBasic functions in VBA.

Jerry Bodoff
 
D

discoverer

Hi,

I think being in toad if we do a printscreen or ALT+printscreen, it is
copied and will be available in the clipboard, if we could trap whether the
user has pressed ALT+printscreen on the keyboard being in toad application,
then we can activate the word and do a selection.paste there and then again
show the user the toad screen.

is it possible like this.

Thanks
 
T

Tony Jollans

It has been some years since I used Toad but i do not believe it has that
kind of capacity (does it have any kind of code interface at all?) and I'm
pretty sure Word has no capacity to listen in the background.

I have no doubt that some sort of Windows application could be written for
this but don't have any idea how to go about it. The best I could come up
with would be a one-click-in-Word solution so that instead of pressing
printscreen you would have to switch to Word and press a button - and this
would be on the lines already discused here just attached to a toolbar
button in Word.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top