?
Solved

Form to Rich Text Box

Posted on 2000-03-14
5
Medium Priority
?
195 Views
Last Modified: 2010-05-02
I have a form with text boxes and labels bound to a database record. I would like to send a picture of this form with its record to a rich text box  in another form (eventually to send it in a notes email). Does anyone know how to do this?
0
Comment
Question by:danlevans
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 14

Accepted Solution

by:
mcrider earned 200 total points
ID: 2617360
First check out this microsoft KB article:

HOWTO: Capture and Print the Screen, a Form, or any Window
http://support.microsoft.com/support/kb/articles/Q161/2/99.ASP?LNG=ENG&SA=MSDN&FR=0 


Use the code in the above article to copy the form to a picturebox... then copy the picturebox to the clipboard and paste it into the RTbox, like this:

     Clipboard.SetData Picture1
     RichTextBox1.SetFocus
     SendKeys "^v", True


Cheers!®©
0
 
LVL 2

Author Comment

by:danlevans
ID: 2619956
mcrider,

I tried your code:

Private Sub cmdEmail_Click()
   Set Picture1.Picture = CaptureForm(frmNCM)
   Clipboard.SetData Picture1
   frmMessage.RichTextBox1.SetFocus
   SendKeys "^v", True
End Sub

The picture has the form image but the clipboard does not it contains a previous copy I had made. The Rich Text Box contains the contents of the clipboard (previous copy not the picture). What Have I done wrong?

Dan
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2621820
Try it like this:

Private Sub cmdEmail_Click()
   Set Picture1 = CaptureForm(frmNCM)
   Clipboard.Clear
   Clipboard.SetData Picture1, vbCFBitmap
   frmMessage.RichTextBox1.SetFocus
   SendKeys "^v", True
End Sub



Cheers!®©
0
 
LVL 2

Author Comment

by:danlevans
ID: 2624490
Thanks. Clearing fixed the problem.
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2624579
Thanks for the points! Glad I could help!


Cheers!®©
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question