Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

TimCottee

Posted on 2001-06-06
4
Medium Priority
?
134 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 400 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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

886 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