Hi Group,
I have the following code, but not sure if this is write, I would like to be
able with the View code, for the document to be opened eg. C:\test.Doc and
with the PRint button for it to Autmatically Print.
The code I have so far is:
Private Sub btnViewDoc_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnViewDoc.Click
Dim View As New System.Diagnostics.ProcessStartInfo()
View.Verb = "View"
View.WindowStyle = ProcessWindowStyle.Maximized
View.FileName = txtFileLocation.Text
View.UseShellExecute = True
System.Diagnostics.Process.Start(View)
End Sub
Private Sub btnPrintDoc_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnPrintDoc.Click
Dim Print As New System.Diagnostics.ProcessStartInfo()
Print.Verb = "Print"
Print.WindowStyle = ProcessWindowStyle.Hidden
Print.FileName = txtFileLocation.Text
Print.UseShellExecute = True
System.Diagnostics.Process.Start(Print)
End Sub
When i try and view or peint using the code I get a error saying:
Additional information: No application is associated with the specified file
for this operation
Any kind person able to point me in the right direction?
Many Thanks
MCN