473,378 Members | 1,456 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,378 software developers and data experts.

Process.Start("Winword.exe") problem

The code below is being used to launch WinWord.exe from a VB.NET program.
Word launches, but displays this error message:

"Word has experienced an error trying to open the file. Try these
suggestions. 1) Check the file permissions for the document or drive. 2)
Make sure there is sufficient free memory and disk space. 3) Open the file
with the Text Recovery converter."

The document that I want to display is on my PC and was created by me. I
ultimately want to open the document in READONLY mode, if possible. Is
there a security switch in the Process.Start statement that I can set to
override the error message?

Here is the code:

Private Sub frmAppointmentWorker_HelpRequested(ByVal sender As Object,
ByVal hlpevent As System.Windows.Forms.HelpEventArgs) Handles
MyBase.HelpRequested

Dim strHelpDocumentPath As String

'determine whether a Help file exists

strHelpDocumentPath = gstrHelpPath & Me.Name & ".doc"

If File.Exists(strHelpDocumentPath) Then

'launch Word

Process.Start("WinWord.exe", strHelpDocumentPath)

'Process.Start("WinWord.exe", "C:\Projects\Human
Services\Documents\Help\frmAppointmentWorker.doc")

Else

MessageBox.Show("A Help document for " & Me.Name & " does not yet
exist.", "Help document not found", MessageBoxButtons.OK,
MessageBoxIcon.Information)

End If

hlpevent.Handled = True

End Sub

Thanks in advance,

Dean Slindee
Nov 21 '05 #1
3 11690
For starters you have a space between 'Human' and 'Services'. I'm certain
that you will have to quote the string to make it work.

If that is, in fact the case, then winword can't find the file. If you think
that the error message is inappropriate then take it up with a winword
group. It is winword throwing the message, not your application.
"Dean Slindee" <sl*****@charter.net> wrote in message
news:w7*****************@fe02.lga...
The code below is being used to launch WinWord.exe from a VB.NET program.
Word launches, but displays this error message:

"Word has experienced an error trying to open the file. Try these
suggestions. 1) Check the file permissions for the document or drive. 2)
Make sure there is sufficient free memory and disk space. 3) Open the file
with the Text Recovery converter."

The document that I want to display is on my PC and was created by me. I
ultimately want to open the document in READONLY mode, if possible. Is
there a security switch in the Process.Start statement that I can set to
override the error message?

Here is the code:

Private Sub frmAppointmentWorker_HelpRequested(ByVal sender As Object,
ByVal hlpevent As System.Windows.Forms.HelpEventArgs) Handles
MyBase.HelpRequested

Dim strHelpDocumentPath As String

'determine whether a Help file exists

strHelpDocumentPath = gstrHelpPath & Me.Name & ".doc"

If File.Exists(strHelpDocumentPath) Then

'launch Word

Process.Start("WinWord.exe", strHelpDocumentPath)

'Process.Start("WinWord.exe", "C:\Projects\Human
Services\Documents\Help\frmAppointmentWorker.doc")

Else

MessageBox.Show("A Help document for " & Me.Name & " does not yet
exist.", "Help document not found", MessageBoxButtons.OK,
MessageBoxIcon.Information)

End If

hlpevent.Handled = True

End Sub

Thanks in advance,

Dean Slindee

Nov 21 '05 #2
"Stephany Young" <noone@localhost> wrote in
news:#b**************@tk2msftngp13.phx.gbl:
For starters you have a space between 'Human' and 'Services'. I'm
certain that you will have to quote the string to make it work.

If that is, in fact the case, then winword can't find the file. If you
think that the error message is inappropriate then take it up with a
winword group. It is winword throwing the message, not your
application.
"Dean Slindee" <sl*****@charter.net> wrote in message
news:w7*****************@fe02.lga...
The code below is being used to launch WinWord.exe from a VB.NET
program. Word launches, but displays this error message:

"Word has experienced an error trying to open the file. Try these
suggestions. 1) Check the file permissions for the document or drive.
2) Make sure there is sufficient free memory and disk space. 3) Open
the file with the Text Recovery converter."

The document that I want to display is on my PC and was created by
me. I ultimately want to open the document in READONLY mode, if
possible. Is there a security switch in the Process.Start statement
that I can set to override the error message?

Here is the code:

Private Sub frmAppointmentWorker_HelpRequested(ByVal sender As
Object,
ByVal hlpevent As System.Windows.Forms.HelpEventArgs) Handles
MyBase.HelpRequested

Dim strHelpDocumentPath As String

'determine whether a Help file exists

strHelpDocumentPath = gstrHelpPath & Me.Name & ".doc"

If File.Exists(strHelpDocumentPath) Then

'launch Word

Process.Start("WinWord.exe", strHelpDocumentPath)

'Process.Start("WinWord.exe", "C:\Projects\Human
Services\Documents\Help\frmAppointmentWorker.doc")

Else

MessageBox.Show("A Help document for " & Me.Name & " does not
yet
exist.", "Help document not found", MessageBoxButtons.OK,
MessageBoxIcon.Information)

End If

hlpevent.Handled = True

End Sub

Thanks in advance,

Dean Slindee



Process.Start("WinWord.exe", strHelpDocumentPath)
I think it's ths line, have a look here:

http://msdn.microsoft.com/library/de...l=/library/en-
us/cpref/html/frlrfsystemdiagnosticsprocessclassstarttopic.asp

It should be Process.Start(strHelpDocumentPath)
The file extention is used to determin what app opens it as stated here:

Starting a process by specifying its file name is similar to typing the
information in the Run dialog box of the Windows Start menu. Therefore,
the file name does not need to represent an executable file. It can be
of any file type for which the extension has been associated with an
application installed on the system. For example the file name can have
a .txt extenstion if you have associated text files with an editor, such
as Notepad, or it can have a .doc if you have associated .doc files with
a word processing tool, such as Microsoft Word.

http://msdn.microsoft.com/library/de...l=/library/en-
us/cpref/html/frlrfsystemdiagnosticsprocessclassstarttopic3.asp

Nov 21 '05 #3
Dean,

A sample with notepad, however in my opinion exactly the same as your
question.
\\\Notepad
Dim p As New Process
Dim pi As New ProcessStartInfo
pi.arguments = "c:\windows\win.ini"
pi.FileName = "notepad.exe"
p.startinfo = pi
p.Start()
///

I hope this helps,

Cor
Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Vilmar Brazão de Oliveira | last post by:
HI people, what is wrong in the code bellow to kill iexplore.exe process after processing my page?? '»»Before comes routines to access data base and to send email. Set objWshell =...
3
by: Wardeaux | last post by:
All, I've written a "setup" wrapper that calls a sequence of "setup.exe", and all works except when I call the setup.exe for the MSDE, then it gets about half way through and then hangs... The...
3
by: bwalke | last post by:
I was wondering how the Process.Start() command can be used in a VB.NET Web Application. I have used this command in a Windows Application before successfully. I want the client side to envoke the...
2
by: Dean Slindee | last post by:
The code below is being used to launch WinWord.exe from a VB.NET program. Word launches, but displays this error message: "Word has experienced an error trying to open the file. Try these...
2
by: Anthony | last post by:
Hello All, Thanks for your help first, I wonder is there any link to sample or documentation that explain how to make .exe in C++ communicate to .exe in C#? I know there is some way like Share...
3
by: google.100.frause | last post by:
Previously I had the same Problem discussed and solved here: http://clariusconsulting.net/blogs/hdl/archive/2005/12/02/410.aspx?CommentPosted=true#commentmessage but now I've got the next...
1
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
If this is the code I use to start another program, what can I use to: System.Diagnostics.Process.Start("EcpKpScript_01.exe"); 1. Stop the process 2. Check if the process is already running? ...
3
by: kimiraikkonen | last post by:
Hi experts, I just want to ask a simple procedure of my simple form. My form has a input textbox and a button. I want this if you can help me: Application user types a command prompt command...
1
by: acmdo | last post by:
Hello, The following question is about the name of file, with commas and periods, using VB.net 2005 when I try to use the process.start instruction I can open a file in explorer with...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.