Opening word with Process.start

T

Thomas Beyerlein

I am trying to open word with process.start but when it opens word it
give me a error that says:
Word experienced an error
Try suggestions:
* check the file permissions
* Make sure there is sufficient free memory
* Open the file with the text recovery

I think it is some thing with word. Any suggestions??

Thanks
Tom

He is my code

Dim diWord As DirectoryInfo = New
DirectoryInfo("C:\ProgramFiles\Microsoft Office\Office11\WINWORD.exe")
If diWord.Exists Then
wrdApp = "C:\Program Files\Microsoft Office\Office11\WINWORD.exe"
Else
wrdApp = "C:\Program Files\Microsoft Outlook\Office11\WINWORD.exe"
End If
'set open dialog properties
With Me.OpenFileDialog1
..Filter = "PDF (*.pdf) | *.pdf|all files (*.*)|*.* | Word Documents
(*.doc) | *.doc"
..FilterIndex = 3
..InitialDirectory = path
..Title = "Open File Dialog"
End With

'show the open dialog and if the user click the ok button
'load the file
If Me.OpenFileDialog1.ShowDialog = DialogResult.OK Then

'Get File name
strFileName = Me.OpenFileDialog1.FileName
MsgBox(Me.OpenFileDialog1.FileName)

Process.Start(wrdApp, strFileName)

End If

End Sub
 
P

Patrice

Write down the command to see if it looks correct? You could also launch the
..doc file. It will launch the associated Word application...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top