473,324 Members | 2,268 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Opening word with Process.start


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
1 2889
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Vinay | last post by:
Hi I have a corrupt word file. I am able to open it with the code given below tr Dim pInfo As System.Diagnostics.ProcessStartInfo = New System.Diagnostics.ProcessStartInfo( pInfo.UseShellExecute...
3
by: Andy Davis | last post by:
I have set up a mail merge document in Word 2003 which gets its data from my Access 2000 database. I want to set up a button on a form that: 1. runs the query to provide the dat for the merge...
0
by: gizmo | last post by:
We have a requirement to initiate more than one instance of an application using the filenames. (the example below will start two instances of MS Word). The problem is that we need to close each...
4
by: Yohancef Chin | last post by:
Hi, Being fairly new to .NET I am looking for a way to call MS Word from an event on a webform, and after the user is finished save that created document to an SQL Server database. Has anyone...
3
by: Yohancef Chin | last post by:
Hi, Being fairly new to .NET I am looking for a way to call MS Word from an event on a webform, and after the user is finished save that created document to an SQL Server database. Has anyone...
4
by: Pieter | last post by:
Hi, From my VB.NET 2005 application I need to be able to open Files an Directory's with their default application: - A word-doc must open in word - A excell-document in Excel etc - in case...
8
by: gazza67 | last post by:
Hi, I want to do something that I thought would be simple but i cant seem to work it out, perhaps someone out there could help me. I want to browse for a file (it will be a word document),...
3
by: sravan_reddy001 | last post by:
Is it possible to run other applications like start MS word, or turn off the system, or run an antivirus program SCAN etc.. using .NET
2
by: =?Utf-8?B?TmFt?= | last post by:
Version: .NET Framework 2.0 In my Windows Forms application, how can I open a file in its native program?. Let’s say a listbox displays a list of file names with full paths; when a user double...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.