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 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")
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 3 11727
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*****@charte r.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 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")
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
"Stephany Young" <noone@localhos t> wrote in
news:#b******** ******@tk2msftn gp13.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*****@charte r.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 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")
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
Process.Start(" WinWord.exe", strHelpDocument Path)
I think it's ths line, have a look here: http://msdn.microsoft.com/library/de...l=/library/en-
us/cpref/html/frlrfsystemdiag nosticsprocessc lassstarttopic. asp
It should be Process.Start(s trHelpDocumentP ath)
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/frlrfsystemdiag nosticsprocessc lassstarttopic3 .asp
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 ProcessStartInf o
pi.arguments = "c:\windows\win .ini"
pi.FileName = "notepad.ex e"
p.startinfo = pi
p.Start()
///
I hope this helps,
Cor This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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
|
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 user install several "Commandline
parameter intensive" setups to get this installed? :)
MTIA
wardeaux
|
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 that it is possible in Web Apps. Here is what I have tried so
far in the web app...
Dim myProcess...
|
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 the Text Recovery converter."
The document that I want to display is on my PC and was created by...
|
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
| |
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 process, redirecting the
output and I enabled the Event Raising.
|
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
|
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" .
|
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 -bbbb.pdf" The letters are any letters.
When I try to execute the command
...
|
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |