Solved

TimCottee

Posted on 2001-06-06
4
127 Views
Last Modified: 2010-05-02
Nuisance that i am could you just extend the last answer to show me how to save a bmp to wordpad doc with the date attached?
0
Comment
Question by:leachim
  • 2
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
bobbit31 earned 100 total points
ID: 6160621
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal _
    hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
    lParam As Any) As Long
Private Const WM_PASTE = &H302

Private Sub Command1_Click()
   
    Dim myPicture As StdPicture
   
    Set myPicture = LoadPicture("C:\my documents\search.gif")

    RichTextBox1.Text = Format(Date, "M/dd/yyyy")
    InsertPictureInRichTextBox RichTextBox1, myPicture
    RichTextBox1.SaveFile "C:\my documents\testbmp.doc"

End Sub


Sub InsertPictureInRichTextBox(RTB As RichTextBox, Picture As StdPicture)
    ' copy into the clipboard
    ' Copy the picture into the clipboard.
    Clipboard.Clear
    Clipboard.SetData Picture
    ' paste into the RichTextBox control
    SendMessage RTB.hWnd, WM_PASTE, 0, 0
End Sub


0
 

Author Comment

by:leachim
ID: 6160691
Thanks bobbit31
0
 

Author Comment

by:leachim
ID: 6176476
Thanks again bobbit31
0
 
LVL 18

Expert Comment

by:bobbit31
ID: 6181989
no problem, glad to help!
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

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 need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

932 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

8 Experts available now in Live!

Get 1:1 Help Now