Hi all
in my appliction i want to send the document through mail i.e: outlook
here is my code
Dim myWS As Object
Dim RegKey As String
Dim Key As String
Key = "HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\"
'access Windows scripting
myWS = CreateObject("WScript.Shell")
'read key from registry
RegKey = myWS.RegRead(Key)
If RegKey = "Microsoft Outlook" Then
Dim mailString As String = "mailto:" & "?subject= &body="
Process.Start(mailString)
Dim aFile As String = attachfile
Dim Ret As IntPtr
While Ret = 0
Application.DoEvents()
Ret = FindWindow(vbNullString, " ")
End While
SendKeys.Send("%if" & attachfile & "{ENTER}")
but it is not attaching the file just it opens the outlook
can anybady tell me where im my code goes wrong?