dear friends
i am creating a project in which i want what ever i am write in textbox it should reach to the outlook express in the subject box but i do not know how to do it.
plz!!! help me in this . its urgent
thanks in advance
shivpreet2k1
Printable View
dear friends
i am creating a project in which i want what ever i am write in textbox it should reach to the outlook express in the subject box but i do not know how to do it.
plz!!! help me in this . its urgent
thanks in advance
shivpreet2k1
Outlook Express doesn't have com interface and therefore its objects cannot be accessed directly.
Use MAPI (VB has mapi controls) which is what OE is based on.
If its just prepopulating text into the subject, sender, or body then its easy touse the ShellExecute API but you will only Create the email and display it, not actually send it.
VB Code:
Option Explicit Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, _ ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _ ByVal nShowCmd As Long) As Long Private Const SW_SHOWNORMAL As Long = 1 Private Sub Command1_Click() ShellExecute Me.hWnd, "Open", "mailto:[email protected]?subject=" & txtSubject.Text & "&body=my message;", vbNullString, "C:\", SW_SHOWNORMAL End Sub
Hi Rob
Thanks for your invaluable help. Can I provide attachment in the sam manner
Thanks in advance
shivpreet2k1
I believe there is but its troublesome as you need to strip out certain characters and stuff. Try a search on the forums for "mailto:"+"&attach".