Howdy!
I have a windows app where you can add attachments to memos. These
attachments can be anything (word, excel, pdf, etc). One form in my
app lists the names of the attachments in a List and the user can
select one to view. My code right now takes the attachment, puts it
into a new file stream to the path C:\Temp, writes the file to that
directory, and then opens that file using a Process.Start.
Everything works great, but I'm sure there is a better way to do this
so that a copy of the file doesn't need to be written to the user's PC
- or to at least delete it after they are done viewing it? Does anyone
have an example? Here is a code snippett of what I am currently using:
--------------
myStream = New System.IO.FileStream(DestFilePath, IO.FileMode.Create,
IO.FileAccess.ReadWrite)
myStream.Write(attachment, 0, attachment.Length)
myStream.Close()
Process.Start("File:\\" & DestFilePath)
--------------
Thanks a bunch!
Michelle