Why doesn't the following code run acrobat?
It throws a file not found exception
Thanks
Dim s As String = sgAppPath + "TCW3Help.pdf"
Try
If Not File.Exists(s) Then
MsgBox("Cannot find " + s, MsgBoxStyle.Exclamation)
Else
s = """" + s + """"
Shell(s)
End If
Catch ex As FileNotFoundException
MsgBox("Unable to open Help file " + s + " check that
Acrobat is installed", MsgBoxStyle.Exclamation)
Catch ex As Exception
ReportBug(ex, "Trying to open help file " + s)
End Try 8 1307
Try this:
Dim s As String = Application.StartupPath & "\TCW3Help.pdf"
Try
If Not IO.File.Exists(s) Then
MessageBox.Show(String.Format("Cannot find {0}", s),
Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
Else
Microsoft.VisualBasic.Shell(s, AppWinStyle.NormalFocus)
End If
Catch ex As IO.FileNotFoundException
MessageBox.Show(String.Format("Unable to open Help file {0}.
Check that Acrobat is installed", s), Me.Text, MessageBoxButtons.OK,
MessageBoxIcon.Exclamation)
Catch ex As Exception
MessageBox.Show(ex, "Trying to open help file " + s)
End Try
I hope this helps
Crouchie1998
BA (HONS) MCP MCSE
Thanks but still get the same thing, exception on the shell command.
Any other ideas?
Crouchie1998 wrote: Try this:
Dim s As String = Application.StartupPath & "\TCW3Help.pdf" Try If Not IO.File.Exists(s) Then MessageBox.Show(String.Format("Cannot find {0}", s), Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation) Else Microsoft.VisualBasic.Shell(s, AppWinStyle.NormalFocus) End If Catch ex As IO.FileNotFoundException MessageBox.Show(String.Format("Unable to open Help file {0}. Check that Acrobat is installed", s), Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation) Catch ex As Exception MessageBox.Show(ex, "Trying to open help file " + s) End Try
I hope this helps
Crouchie1998 BA (HONS) MCP MCSE
I changed the filename to one on my system & it worked for me. Just play
around with the Try Catch End Try block.
Sorry, but I don't have the time to do anything else for the next 3-4 hours,
but later if you don't have a solution then I'll re-write it for you.
Crouchie1998
BA (HONS) MCP MCSE
Jack,
Did you try it already with Process.Start(filenme)
(Needs a reference to be set).
Pdf, should of couse start when you click in explorer on that, otherwise you
have to name the program in this method as well.
In addition when you try something, set than first the hardcoded path in it,
that makes finding an error much easier.
I hope this helps,
Cor
"Crouchie1998" <cr**********@spamcop.net> schrieb: Dim s As String = Application.StartupPath & "\TCW3Help.pdf"
=> 'System.IO.Path.Combine'. Otherwise the path will contain two
backslashes if the application is installed to a drive's root directory.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Cor,
Thanks that worked!
Cor Ligthert wrote: Jack,
Did you try it already with Process.Start(filenme) (Needs a reference to be set).
Pdf, should of couse start when you click in explorer on that, otherwise you have to name the program in this method as well.
In addition when you try something, set than first the hardcoded path in it, that makes finding an error much easier.
I hope this helps,
Cor
Thanks, still no joy but took Cors suggestion and used process.start -
no problems.
One thing I can say for .net, there seem to a thousand ways of doing
anything and one eventually works!
Crouchie1998 wrote: I changed the filename to one on my system & it worked for me. Just play around with the Try Catch End Try block.
Sorry, but I don't have the time to do anything else for the next 3-4 hours, but later if you don't have a solution then I'll re-write it for you.
Crouchie1998 BA (HONS) MCP MCSE
I just recoded your solution because that's the way you wanted to code it.
Process.Start is an easier way, I agree
Crouchie1998
BA (HONS) MCP MCSE This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: root |
last post by:
hi there,
I've tried to install mysql-3.23.55.tar.gz but failed. Firstly, I've
created directory /home/users/mysql and add group for mysql. Those are the
command that I've used previously:
...
|
by: Sin |
last post by:
Hello everyone,
I'm totally stumped at how little info I can find in MSDN or on the web
concerning this. It's almost as if only microsoft personel hold the key to
these secrets or something!!!
...
|
by: Chris |
last post by:
Ok I have made an .net active x control
if you want to view it
http://mapguide.alignex.com/test/axtest2.html
Site needs to be fully trusted.. So i will understand if you dont want to
view it.
...
|
by: Cheryl Langdon |
last post by:
Hello everyone,
This is my first attempt at getting help in this manner. Please
forgive me if this is an inappropriate request.
I suddenly find myself in urgent need of instruction on how to...
|
by: gavino |
last post by:
This seems easy but I have been asking tcl and python IRC chat all day
and no one gave an answer.
I have 100 servers which need a new backup server added to a text file,
and then the backup agent...
|
by: Pucca |
last post by:
I have the following C++ function exported. The returned type is a typedef
enum and the 2nd parm passed in is a class type that I defined.
How do I declare the marshalas for the parm and how do I...
|
by: mistral |
last post by:
Need compile python code, source is in html and starts with parameters:
#!/bin/sh -
"exec" "python" "-O" "$0" "$@"
I have installed ActivePython for windows.
|
by: Mark |
last post by:
Hello,
What I need to know is if there is a better method to run/edit modules
on my pc.
I'm currently running the IDLE shell under Python 2.5, on Windows XP.
Every time I edit my .txt or .py...
|
by: ohaqqi |
last post by:
Hi everybody. I haven't programmed anything in about 8 years, I've read up a little bit on C and need to write a shell in C. I want to use strtok() to take an input from a user and parse it into the...
|
by: rdabane |
last post by:
I'm trying to perform following type of operation from inside a python
script.
1. Open an application shell (basically a tcl )
2. Run some commands on that shell and get outputs from each command...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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: 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,...
|
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...
|
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...
|
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...
| |