By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,558 Members | 1,607 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,558 IT Pros & Developers. It's quick & easy.

Opening MS Paint and Pasting Via Code

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.