Automating Applications Question

  • Thread starter Thread starter plangla
  • Start date Start date
P

plangla

I am trying to start the default e-mail browser automatically from a menu
item click. The code works for the web browser but not for e-mail.

This is the sample for web browser that works

Private Sub MenuItem25_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem25.Click

System.Diagnostics.Process.Start("http://www.company.com")

End Sub



This does not

Private Sub MenuItem26_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem26.Click

System.Diagnostics.Process.Start("(e-mail address removed)")

End Sub



I am not sure what is wrong. Please help

Thanks Perry Langla
 
plangla said:
I am trying to start the default e-mail browser automatically from a menu
item click. The code works for the web browser but not for e-mail.

This is the sample for web browser that works

Private Sub MenuItem25_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem25.Click

System.Diagnostics.Process.Start("http://www.company.com")

End Sub



This does not

Private Sub MenuItem26_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem26.Click

System.Diagnostics.Process.Start("(e-mail address removed)")

End Sub



I am not sure what is wrong. Please help

Thanks Perry Langla

Problem is that system does not have a default for (e-mail address removed).

To see this start button run and then type in the address. You will get the
message that windows does not know what to do with it. Now put
mailto:[email protected] and it should start a new message in your mail
program.

The version of Process.Start you are using assumes that a filename /URL will
have a default program associated with it. mailto: is an association in
most windows environments.

Hope this helps
Lloyd Sheen
 
This does not

Private Sub MenuItem26_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem26.Click

System.Diagnostics.Process.Start("(e-mail address removed)")

End Sub

try: System.Diagnostics.Process.Start("mailto:[email protected]")
 
Back
Top