Solved

Form to Rich Text Box

Posted on 2000-03-14
5
190 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Window placement 17 75
Replace Formatted Numbers with text 9 61
VBA Shell can't Find Word document 11 76
Using an encrypted  value to decrypt and display contents in vb6 9 49
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

912 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

21 Experts available now in Live!

Get 1:1 Help Now