View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
smartin smartin is offline
external usenet poster
 
Posts: 915
Default Taking a picture of a userform?

My bad. I found this API call that does the trick of getting an image to
the clipboard.
(from http://word.mvps.org/FAQS/MacrosVBA/PrtSc.htm)

Option Explicit

Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal _
bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

Private Const VK_SNAPSHOT = &H2C

Sub PrintScreen()
keybd_event VK_SNAPSHOT, 1, 0, 0
End Sub


Webtechie wrote:
Hi Smartin,

I was looking to do this through code.

Thanks.

Tony

"smartin" wrote:

Webtechie wrote:
Hello,

I had to create for my boss a userform that brought in charts. I found on
the internet somethat allowed me to save a chart as an image and then bring
that image into a userform control. Great.

Then I had to create a userform that took all this data and a lot of
formulas and created a data table to explain the charts.

Now I have to create a report which bring in the charts and the data table.
I would like to take a picture of the userform rather than having to rebuild
my report database and populate it with all the database from the transaction
database.

Does anyone know of a way to take a snapshot of a userform? Maybe be a dumb
question and a longshot, but I thought I would ask.

Thanks

Click on the form, then press Alt+PrintScr. This will place an image of
the form on the clipboard. Paste in document.

This works with any window or dialog BTW. Pressing PrintScr (without
Alt) captures the entire screen.