Solved

Form to Rich Text Box

Posted on 2000-03-14
5
189 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
  • 3
  • 2
5 Comments
 
LVL 14

Accepted Solution

by:
mcrider earned 50 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks. Clearing fixed the problem.
0
 
LVL 14

Expert Comment

by:mcrider
Comment Utility
Thanks for the points! Glad I could help!


Cheers!®©
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now