By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,556 Members | 1,663 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,556 IT Pros & Developers. It's quick & easy.

Opening word with Process.start

P: n/a

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

*** Sent via Developersdex http://www.developersdex.com ***
Feb 15 '06 #1
Share this Question
Share on Google+
1 Reply


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

--
Patrice

"Thomas Beyerlein" <tb***@yahoo.com> a écrit dans le message de
news:O6*************@TK2MSFTNGP09.phx.gbl...

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

*** Sent via Developersdex http://www.developersdex.com ***

Feb 15 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.