Screen capture and paste it in doc

sai charan

New Member
Joined
Nov 12, 2013
Messages
3
Can someone please help me with a macro to do the following activity
Firstly when we click on print screen it has to automatically open a word doc and paste the image in it
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
you could try something like:
Code:
sub paste_existing_screencap_to_word()
Dim word As Object
Dim doc As Object
On Error Resume Next

Set word = GetObject(, "word.application") 'gives error 429 if Word is not open
If Err = 429 Then
    Set word = CreateObject("word.application") 'creates a Word application
    Err.Clear
End If

With word
    .Visible = True
    .Documents.Add
End With

With word.Selection
        .Range.PasteSpecial
End With

End Sub
 
Upvote 0
Thanks for sharing the code.
This works fine when we have some data in the clip board only for once.
What i need is when i click print screen it has to paste in the same document for n number of times.
 
Upvote 0
Thanks for sharing the code.
This works fine when we have some data in the clip board only for once.
What i need is when i click print screen it has to paste in the same document for n number of times.

Can you qualify n number of times. For future reference, this is the first time you have mentione needing it for n number of times. That sort of information would have been extremel handy in the first post.

So, please explain how many times you want to paste it, is this always the same, is it a variable captured in a file/cell or inputbox? Is it being pasted into the same document or a new document each time.

Are you able to just loop the code yourself?
 
Upvote 0
Thanks for your valuable suggestion,I would have communicated the same in first post.
The thing is we need to start the macro,then whenever we are giving print screen the image has to be posted in the same document which is opened ,then if we stop the macro code all the screenshots should be in the same doc.
I am trying to paste every screen shot(image) in the same document.
No i am not able to loop the code.
So please help me in solving this
 
Upvote 0
If you're just adding a screen dump to an existing file, can't you just paste it into the bottom of the word doc once you have captured the screen?
You can't loop a code where you haven't captured the screen shots yet.
It would be easier to just press Control + Printscreen, go to word, press control + V
 
Upvote 0

Forum statistics

Threads
1,223,626
Messages
6,173,415
Members
452,514
Latest member
cjkelly15

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top