ngochoan2006 0 Newbie Poster

I have a question for you, I want make a program by vb, From it can send picture (gif) to message of Outlook ( Express or Outlook Office ).
But I can't write code !!! I can send text to it, but I can't send picture to it.
Can you help me ?
this code for send a text into new message :

Private Const WM_CHAR = &H102
 
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
 
 
Private Sub Command2_Click()
 Dim outlook As Long, hEdit, a1, a2 As Long ' Outlook là dùng tha(`ng Express
    outlook = FindWindow("ATH_Note", vbNullString) ' ATH_Note là Class cu?a Outlook cha
    hEdit = FindWindowEx(outlook, 0&, "ME_DocHost", vbNullString) ' Internet Explorer_Server là Class cu?a vùng soa.n thu+
    a1 = FindWindowEx(hEdit, 0&, "##MimeEdit_Server", vbNullString)
    a2 = FindWindowEx(a1, 0&, "Internet Explorer_Server", vbNullString)
    'Ky tu A = 65
    PostMessage a2, WM_CHAR, 65, 0&
End Sub

How to send picture ???
Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.