473,569 Members | 2,790 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 users to be able 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? Security switch for readonly access?

Here is the code:

Private Sub frmAppointmentW orker_HelpReque sted(ByVal sender As Object,
ByVal hlpevent As System.Windows. Forms.HelpEvent Args) Handles
MyBase.HelpRequ ested

Dim strHelpDocument Path As String

'determine whether a Help file exists

strHelpDocument Path = gstrHelpPath & Me.Name & ".doc"

If File.Exists(str HelpDocumentPat h) Then

'launch Word

Process.Start(" WinWord.exe", strHelpDocument Path)

'Process.Start( "WinWord.ex e", "C:\Projects\Hu man
Services\Docume nts\Help\frmApp ointmentWorker. doc") 'the string in
strHelpDocument Path

Else

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

End If

hlpevent.Handle d = True

End Sub

Thanks in advance,

Dean Slindee

Nov 21 '05 #1
2 4503
You could try an exception handler to catch this message around your process
start. I assume it starts and opens the document in any case, so all you
want to do is prevent it throwing out of your program.

try

Process.Start

Catch whatevertheexce ptionisCOMExcep tion

End Try
"Dean Slindee" <sl*****@charte r.net> wrote in message
news:J1******** *****@fe03.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 users to be able 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? Security switch for readonly access?

Here is the code:

Private Sub frmAppointmentW orker_HelpReque sted(ByVal sender As Object,
ByVal hlpevent As System.Windows. Forms.HelpEvent Args) Handles
MyBase.HelpRequ ested

Dim strHelpDocument Path As String

'determine whether a Help file exists

strHelpDocument Path = gstrHelpPath & Me.Name & ".doc"

If File.Exists(str HelpDocumentPat h) Then

'launch Word

Process.Start(" WinWord.exe", strHelpDocument Path)

'Process.Start( "WinWord.ex e", "C:\Projects\Hu man
Services\Docume nts\Help\frmApp ointmentWorker. doc") 'the string in
strHelpDocument Path

Else

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

End If

hlpevent.Handle d = True

End Sub

Thanks in advance,

Dean Slindee

Nov 21 '05 #2
"Dean Slindee" <sl*****@charte r.net> schrieb:
[...]


Please stay in the original thread...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #3

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

Similar topics

10
7429
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 = Server.CreateObject("WScript.Shell") objWshell.Run "%COMSPEC% /C kill iexplore.exe", 0, TRUE VILMAR BRAZIL
3
3071
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 MSDE setup works fine from a CMD prompt... anyone know of articles or known issues with this technique, and what are my alternatives to having my...
3
5015
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 .exe application by clicking a button and want the .exe to run on the server. I have read in groups that it is not possible and also have heard...
3
11713
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 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...
2
2745
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 Memory, COM but I really need a place that I could get jump start Thanks Have a wonderful day Anthony
3
8967
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 problem. "application failed to initialize properly (0xc0000142). Click OK to terminate the application.". I'm running a service, trying to create a...
1
1806
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? It seems to me that this was much easier in VB 6. 0 Thanks CM
3
5099
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 like "dir" into "textbox", then after clicking "button", command prompt(cmd) should run with the prompt that user has written already into "textbox"...
1
4448
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 process.start("explorer.exe", "/n,/e,/select" & fullpath) but I do not know how to open the files when the name is some thing like "xxxxxx, yyyy - aaaa...
0
7694
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7921
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7666
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5504
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2107
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.