Taking a picture of a userform?

W

Webtechie

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
 
S

smartin

Webtechie said:
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.
 
S

smartin

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
 

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