Hi
How can I make vb.net open a document in its respective app; word, excel
etc. from a documents name and path? e.g. c:\...\mydoc.doc should
automatically open in word.
Thanks
Regards 13 1065
* "John" <jo**@nospam.infovis.co.uk> scripsit: How can I make vb.net open a document in its respective app; word, excel etc. from a documents name and path? e.g. c:\...\mydoc.doc should automatically open in word.
\\\
Dim p As New System.Diagnostics.ProcessStartInfo()
p.Verb = "print"
p.WindowStyle = ProcessWindowStyle.Hidden
p.FileName = "C:\filename.doc"
p.UseShellExecute = True
System.Diagnostics.Process.Start(p)
///
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
* "John" <jo**@nospam.infovis.co.uk> scripsit: How can I make vb.net open a document in its respective app; word, excel etc. from a documents name and path? e.g. c:\...\mydoc.doc should automatically open in word.
\\\
Dim p As New System.Diagnostics.ProcessStartInfo()
p.Verb = "print"
p.WindowStyle = ProcessWindowStyle.Hidden
p.FileName = "C:\filename.doc"
p.UseShellExecute = True
System.Diagnostics.Process.Start(p)
///
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Thanks. Do I need to do any cleanup afterwards too, like close the process
etc.?
Regards
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:O9**************@TK2MSFTNGP10.phx.gbl... * "John" <jo**@nospam.infovis.co.uk> scripsit: How can I make vb.net open a document in its respective app; word, excel etc. from a documents name and path? e.g. c:\...\mydoc.doc should automatically open in word.
\\\ Dim p As New System.Diagnostics.ProcessStartInfo() p.Verb = "print" p.WindowStyle = ProcessWindowStyle.Hidden p.FileName = "C:\filename.doc" p.UseShellExecute = True System.Diagnostics.Process.Start(p) ///
-- Herfried K. Wagner [MVP] <http://www.mvps.org/dotnet>
Thanks. Do I need to do any cleanup afterwards too, like close the process
etc.?
Regards
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:O9**************@TK2MSFTNGP10.phx.gbl... * "John" <jo**@nospam.infovis.co.uk> scripsit: How can I make vb.net open a document in its respective app; word, excel etc. from a documents name and path? e.g. c:\...\mydoc.doc should automatically open in word.
\\\ Dim p As New System.Diagnostics.ProcessStartInfo() p.Verb = "print" p.WindowStyle = ProcessWindowStyle.Hidden p.FileName = "C:\filename.doc" p.UseShellExecute = True System.Diagnostics.Process.Start(p) ///
-- Herfried K. Wagner [MVP] <http://www.mvps.org/dotnet>
* "John" <jo**@nospam.infovis.co.uk> scripsit: Thanks. Do I need to do any cleanup afterwards too, like close the process etc.?
No.
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
* "John" <jo**@nospam.infovis.co.uk> scripsit: Thanks. Do I need to do any cleanup afterwards too, like close the process etc.?
No.
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
OK, it works fine for doc, html etc. But I am having problem with pdf and
mpg. I am using blank verb and providing full filename with extension.
p.WindowStyle = ProcessWindowStyle.Hidden
p.FileName = "C:\MyPDF.pdf"
In case of pdf I get the adobe acrobat splash but no document appears once
acrobat is loaded. In mpg, windows player does not appear but the audio
starts to play. If I run the code again them the application (acrobat or
windows player) appears.
What am I missing?
Thanks
Regards
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ur**************@TK2MSFTNGP10.phx.gbl... * "John" <jo**@nospam.infovis.co.uk> scripsit: Thanks. Do I need to do any cleanup afterwards too, like close the
process etc.?
No.
-- Herfried K. Wagner [MVP] http://www.mvps.org/dotnet
OK, it works fine for doc, html etc. But I am having problem with pdf and
mpg. I am using blank verb and providing full filename with extension.
p.WindowStyle = ProcessWindowStyle.Hidden
p.FileName = "C:\MyPDF.pdf"
In case of pdf I get the adobe acrobat splash but no document appears once
acrobat is loaded. In mpg, windows player does not appear but the audio
starts to play. If I run the code again them the application (acrobat or
windows player) appears.
What am I missing?
Thanks
Regards
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ur**************@TK2MSFTNGP10.phx.gbl... * "John" <jo**@nospam.infovis.co.uk> scripsit: Thanks. Do I need to do any cleanup afterwards too, like close the
process etc.?
No.
-- Herfried K. Wagner [MVP] http://www.mvps.org/dotnet
* "John" <jo**@nospam.infovis.co.uk> scripsit: OK, it works fine for doc, html etc. But I am having problem with pdf and mpg. I am using blank verb and providing full filename with extension.
p.WindowStyle = ProcessWindowStyle.Hidden p.FileName = "C:\MyPDF.pdf"
In case of pdf I get the adobe acrobat splash but no document appears once acrobat is loaded. In mpg, windows player does not appear but the audio starts to play. If I run the code again them the application (acrobat or windows player) appears.
Do you want the application to appear?
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
I just like it to work like when a file is double clicked in windows
explorer. Most of the time the application appears. It is important for
acrobat to appear to read the document. Also windows player is needed when
mpg is a video.
Regards
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:OU**************@TK2MSFTNGP10.phx.gbl... * "John" <jo**@nospam.infovis.co.uk> scripsit: OK, it works fine for doc, html etc. But I am having problem with pdf
and mpg. I am using blank verb and providing full filename with extension.
p.WindowStyle = ProcessWindowStyle.Hidden p.FileName = "C:\MyPDF.pdf"
In case of pdf I get the adobe acrobat splash but no document appears
once acrobat is loaded. In mpg, windows player does not appear but the audio starts to play. If I run the code again them the application (acrobat or windows player) appears.
Do you want the application to appear?
-- Herfried K. Wagner [MVP] <http://www.mvps.org/dotnet>
* "John" <jo**@nospam.infovis.co.uk> scripsit: I just like it to work like when a file is double clicked in windows explorer. Most of the time the application appears. It is important for acrobat to appear to read the document. Also windows player is needed when mpg is a video.
Why do you set 'WindowStyle' to 'Hidden'?
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Sorry, it was in your original code and I left it like that., So, is that I
need to change?
Regards
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:e0**************@TK2MSFTNGP09.phx.gbl... * "John" <jo**@nospam.infovis.co.uk> scripsit: I just like it to work like when a file is double clicked in windows explorer. Most of the time the application appears. It is important for acrobat to appear to read the document. Also windows player is needed
when mpg is a video.
Why do you set 'WindowStyle' to 'Hidden'?
-- Herfried K. Wagner [MVP] <http://www.mvps.org/dotnet>
* "John" <jo**@nospam.infovis.co.uk> scripsit: Sorry, it was in your original code and I left it like that., So, is that I need to change?
Yes, remove the line. I feel sorry for not removing it in the original
post.
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jawahar Rajan |
last post by:
All,
I have a printer friendly page that is opened when a user clicks a link on
my page to get the printer friendly version,
How ever when they close out the printer friendly version and return to...
|
by: Display Name |
last post by:
When this form's being submitted, two windows are opening instead of only
one
here is the function I'm using:
function subForm(){
//insert form validation here
//if form is valid, open a...
|
by: D. Alvarado |
last post by:
Hello,
I am trying to open a window containing an image and I would like
the image to be flush against the window -- i.e. have no padding or
border. Can I make this happen with a single call to a...
|
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...
|
by: Colin Halliday |
last post by:
I have a Word 2003 mail merge main document (form letter) that is linked to another Word document data source for the mail merge.
If I open this doc using the Word GUI, it first asks me to...
|
by: Cedric |
last post by:
Hi Folks,
I'm wondering if someone has already succeed to open a word2000
document located on server side with javascript code executed by a web
browser on client side.
In fact, i make it...
|
by: =?Utf-8?B?V2FubmFiZQ==?= |
last post by:
I am creating a webpage and opening it as a Word document. Problem is that as
I create one of the questions, some of the text is not appearing in the
document as it should. As I step through it, I...
|
by: aarthiraaj |
last post by:
In my user screen I have view link, if I click this link it will go to servlet and open one word document. It is opening properly, but while opening the attachment it generate one dialog box like...
|
by: abhishekbrave |
last post by:
The code below is opening a calendar on mouse over in the same window.
I need the calendar to be opened in new window.
Have to fulfill this requirement urgentely so posting the whole code here.
I...
|
by: rlu |
last post by:
Is there a way to print a pdf document without opening it, if user just select the pdf files in the checkbox and click a button?
I tried the following two methods, but both fail.
1. open a new...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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...
|
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...
|
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
|
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: 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: 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...
| |