|
-
Jan 23rd, 2004, 03:09 AM
#1
Thread Starter
Member
autorun outlook from winforms
Hi,
I'm really stuck on this.
Suppose I have an outlook email (Ei0001.eml) that is stored on my C-disk on the location: c:\email\Ei0001.eml .
Suppose that I have a button on my form that when it's clicked should open the specified email (Ei0001 in this case).
How do I have to code this?
Thanks.
-
Jan 23rd, 2004, 03:51 AM
#2
Thread Starter
Member
I tried the following
VB Code:
imports system.io
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim filename As String
Dim FS As FileStream
filename = "C:\Eu0001.eml"
FS = File.Open(filename, FileMode.Open)
End Sub
But the email isn't opened. I get an error message:
An unhandled exception of type 'System.IO.IOException' occurred in mscorlib.dll
Additional information: The process cannot access the file "C:\Eu1224.eml" because it is being used by another process.
While my outlook express isn't activated. What am i doing wrong??
Jinte
-
Jan 25th, 2004, 06:18 AM
#3
Thread Starter
Member
-
Jan 25th, 2004, 07:08 AM
#4
Hi.
Try :
VB Code:
Process.Start("C:\Eu0001.eml")
This should open the file in the asociated (spelling... ) program. In this case Outlook
I wish I could think of something witty to put in my sig...
...Currently using VS2013...
-
Jan 26th, 2004, 02:50 PM
#5
Thread Starter
Member
thanks pax,
your suggestion worked.
Jinte
-
Jan 27th, 2004, 08:20 AM
#6
yay gay
Originally posted by jinte
I tried the following
VB Code:
imports system.io
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim filename As String
Dim FS As FileStream
filename = "C:\Eu0001.eml"
FS = File.Open(filename, FileMode.Open)
End Sub
But the email isn't opened. I get an error message:
An unhandled exception of type 'System.IO.IOException' occurred in mscorlib.dll
Additional information: The process cannot access the file "C:\Eu1224.eml" because it is being used by another process.
While my outlook express isn't activated. What am i doing wrong??
Jinte
I think it's quite clear that what you're doing that way is OPENING the file as a stream and not EXECUTING it..
\m/  \m/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|