Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 987
  • Last Modified:

Export a form as .JPG

I can export charts (graphs) using graphchart.export.

Is it possible to export a form as .JPG file.  I have many graphs with additional controls on the form that need to be included in the jpg output.

If possible, please explain how for additional points.

Thanks

Elton
0
katzwhite
Asked:
katzwhite
3 Solutions
 
HobsonTCommented:
There may be a way through code, but I don't know it.

You could do it manually with the assistance of a graphics program that will save in jpg format. To do this open the form that you want to export, press and hold the Alt key, press the Print Screen key (usually near the Scroll Lock key) open your graphics program and use paste (Ctrl-V) to paste the image, save it as a jpg.

Hope this helps.

Trevor
0
 
Alan WarrenCommented:
As far as I know you can't export and access form as a jpg

but you can copy to clipboard and paste into another app, say photoed.exe

Alt + PrintScreen to copy form when form has focus.

Ctl + V to paste into another app.

hth
Alan
0
 
Ryan ChongCommented:
Yes, definitely can be done.

What i will do is put a Imag Control (Picture Box) in the form, make it Visible to False (No), then try use below code to generate the JPG file.

Here is a popular sample that uses the Intel JPG DLL to allow you to save a picturebox's picture out to a JPG file:

http://www.vbaccelerator.com/codelib/gfx/vbjpeg.htm

Hope this helps
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Ryan ChongCommented:
And here is an example to capture form image:

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 TheScreen = 0
 Private Const TheForm = 1

Private Sub Command1_Click()
    Dim s As Integer
    s = IIf(Option1(0).Value, TheScreen, TheForm)
    keybd_event vbKeySnapshot, s, 0&, 0& 'Change to TheScreen to make Screen Capture
    DoEvents
    Picture1.Cls
    Picture1.Picture = Clipboard.GetData(vbCFBitmap)
    'Printer.PaintPicture Clipboard.GetData(vbCFBitmap), 0, 0
    'Printer.EndDoc
End Sub

Private Sub Form_Load()
    Option1(0).Caption = "Print Screen"
    Option1(1).Caption = "Print Form"
    Option1(0).Value = True
    Command1.Caption = "Print Now"
    Command2.Caption = "Print Form"
End Sub
0
 
Alan WarrenCommented:
ryancys,

What reference are you using to expose the clipboard

Picture1.Cls
'err.description = "method or data member not found"

Picture1.Picture = Clipboard.GetData(vbCFBitmap)
'err.description = "Variable not defined"


vested interest

alan

0
 
Ryan ChongCommented:
Seems to be not working in VBA... the code above is applied in VB, sorry. Will find another solution..
0
 
katzwhiteAuthor Commented:
We can use a graphics problem as long as it can be started with a control button that will activate a script that will pass the stored image name and execute automatically with no user intervention.

Since we can print the form, an ideal solution would be to convert the printed image to jpg.  Kinda like creating a pdf file by printing to a pdf printer.

Any suggesitons?

Thanks

Elton
0
 
nexusnationCommented:
Hi katzwhite,
This question has been abandoned and needs to be finalized (96 days since last comment).

   You can accept an answer, split the points, or get a refund. Go to
   http://www.cityofangels.com/Experts/Closing.htm for information and options.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

nexusnation
EE Cleanup Volunteer for Microsoft Access
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now