471,071 Members | 1,276 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,071 software developers and data experts.

Opening MS Paint and Pasting Via Code

In my not too successful attempts to get an OLE chart object (Graph
11.0) that has been manipulated on a form to be reproduced on a report,
I am considering the following procedure. First copy the graph area to
the clip board (easy enough using Me.OleGraphControl.ChartArea.Copy).
Next open an instance of MS Paint, paste the clipboard into the file and
save as something like "Picture.bmp" in the same directory as the FE
Access app. A picture control on the report would link to Picture.bmp.

I'm not sure about opening an instance of MS Paint and saving the file.
Also not sure about pasting - I regularly use Terry Kreft's API code
posted on the Access Web for copying things toi the clipboard, but I'm
not sure how to paste.

Any suggestions on any or all of:

1) Opening MS Paint
2) Pasting clipboard contents to MS Paint
3) Saving MS Paint file

would be very much appreciated, thanks in advance.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
Oct 17 '06 #1
1 8563
Hi, Tim.
>Next open an instance of MS Paint, paste the clipboard into the file
and save as something like "Picture.bmp"
A search of Google groups for "mspaint automation" suggests that what
you intend to do is not possible without resorting to a kluge like
SendKeys to "control" an instance of MS_Paint.

Under Win2K you could use the Kodak Image Edit Control (ImgEdit.ocx)
something like this
With Me.ImgEdit1
.DisplayBlankImage 1, 1, , , wiPageTypeRGB24
.ClipboardPaste
.SaveAs "c:\foo.bmp", wiFileTypeBMP
End With
Unfortunately, WinXP doesn't include ImgEdit.ocx :( .
Gord
Tim Marshall wrote:
In my not too successful attempts to get an OLE chart object (Graph
11.0) that has been manipulated on a form to be reproduced on a report,
I am considering the following procedure. First copy the graph area to
the clip board (easy enough using Me.OleGraphControl.ChartArea.Copy).
Next open an instance of MS Paint, paste the clipboard into the file and
save as something like "Picture.bmp" in the same directory as the FE
Access app. A picture control on the report would link to Picture.bmp.

I'm not sure about opening an instance of MS Paint and saving the file.
Also not sure about pasting - I regularly use Terry Kreft's API code
posted on the Access Web for copying things toi the clipboard, but I'm
not sure how to paste.

Any suggestions on any or all of:

1) Opening MS Paint
2) Pasting clipboard contents to MS Paint
3) Saving MS Paint file

would be very much appreciated, thanks in advance.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
Oct 17 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Shumit Rehman | last post: by
7 posts views Thread by hamil | last post: by
7 posts views Thread by Martien van Wanrooij | last post: by
reply views Thread by =?Utf-8?B?TWljaGFlbCBKLiBWaXNpbnRpbg==?= | last post: by
2 posts views Thread by mark.bergman | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.