[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Form to Rich Text Box

Posted on 2000-03-14
5
Medium Priority
?
197 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 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

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.

Question has a verified solution.

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

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

834 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