In the old days of Visual Basic for Applications, I successfully opened a
file (of any file type: .dwg .pdf .doc etc) in its own application using:
ActiveWorkbook.FollowHyperlink Address:=filepath, NewWindow:=True
I don't want to read/write the file, nor to display FileDialog, I just want
to open a named file it in its own application (usually Adobe.pdf).
In Visual Studio 2005 I can successfully find the file using wildcards in:
My.Computer.FileSystem.GetFiles
but neither of the following will open the file or report an error:
System.IO.File.Open(filepath, IO.FileMode.Open)
Microsoft.VisualBasic.FileOpen(1, filepath, OpenMode.Random)
Presumably, I am not using the appropriate Method. Probably the answer's
simple, can anyone help, please?
--
dave 3 3657
DF,
Open a file is in my idea a kind in my idea misplaced term still existing
from the tapereader. You want to read a file from disk I assume, but than
the application has to use it.
Mostly that what is readed using file access is a string. It can as well be
a part of a special application. But than has the application like Office as
you showed the code to do that.
Reading a file is mostly using the streamreader. http://windowssdk.msdn.microsoft.com...eamreader.aspx
I hope this helps something,
Cor
"df" <df@discussions.microsoft.comschreef in bericht
news:ED**********************************@microsof t.com...
In the old days of Visual Basic for Applications, I successfully opened a
file (of any file type: .dwg .pdf .doc etc) in its own application using:
ActiveWorkbook.FollowHyperlink Address:=filepath, NewWindow:=True
I don't want to read/write the file, nor to display FileDialog, I just
want
to open a named file it in its own application (usually Adobe.pdf).
In Visual Studio 2005 I can successfully find the file using wildcards in:
My.Computer.FileSystem.GetFiles
but neither of the following will open the file or report an error:
System.IO.File.Open(filepath, IO.FileMode.Open)
Microsoft.VisualBasic.FileOpen(1, filepath, OpenMode.Random)
Presumably, I am not using the appropriate Method. Probably the answer's
simple, can anyone help, please?
--
dave
Her you open as if you wanted to read/write the file content.
You have actually to "launch" the file i.e. the associated application will
launch and will open the file. See Process.Start...
--
Patrice
"df" <df@discussions.microsoft.coma écrit dans le message de news: ED**********************************@microsoft.com...
In the old days of Visual Basic for Applications, I successfully opened a
file (of any file type: .dwg .pdf .doc etc) in its own application using:
ActiveWorkbook.FollowHyperlink Address:=filepath, NewWindow:=True
I don't want to read/write the file, nor to display FileDialog, I just
want
to open a named file it in its own application (usually Adobe.pdf).
In Visual Studio 2005 I can successfully find the file using wildcards in:
My.Computer.FileSystem.GetFiles
but neither of the following will open the file or report an error:
System.IO.File.Open(filepath, IO.FileMode.Open)
Microsoft.VisualBasic.FileOpen(1, filepath, OpenMode.Random)
Presumably, I am not using the appropriate Method. Probably the answer's
simple, can anyone help, please?
--
dave
Patrice
Splendid!
It works, many thanks - I would have spent days trying to find it.
--
dave
"Patrice" wrote:
Her you open as if you wanted to read/write the file content.
You have actually to "launch" the file i.e. the associated application will
launch and will open the file. See Process.Start...
--
Patrice
"df" <df@discussions.microsoft.coma écrit dans le message de news: ED**********************************@microsoft.com...
In the old days of Visual Basic for Applications, I successfully opened a
file (of any file type: .dwg .pdf .doc etc) in its own application using:
ActiveWorkbook.FollowHyperlink Address:=filepath, NewWindow:=True
I don't want to read/write the file, nor to display FileDialog, I just
want
to open a named file it in its own application (usually Adobe.pdf).
In Visual Studio 2005 I can successfully find the file using wildcards in:
My.Computer.FileSystem.GetFiles
but neither of the following will open the file or report an error:
System.IO.File.Open(filepath, IO.FileMode.Open)
Microsoft.VisualBasic.FileOpen(1, filepath, OpenMode.Random)
Presumably, I am not using the appropriate Method. Probably the answer's
simple, can anyone help, please?
--
dave
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: jmd |
last post by:
Hello.
I have downloaded and installed Visual Studio 2005 February CTP -- Professional Edition (English) from msdn.
All works fine (with a few bugs) except the Quickstarts.
The Quickstarts install...
|
by: Jim |
last post by:
I've got an asp.net site that is published to another computer with Windows
2000 and IIS on it using 'Publish/Remote Site'(http://name/BuySellTrade).
Publishing updates the folders in the...
|
by: Jim |
last post by:
I've got a simple asp.net application that is published to a server using
2000 and IIS. No files are copied to the server.
What needs to be done to copy the files?
|
by: Jerad Rose |
last post by:
I recently installed Visual Studio 2003, after having already installed VS
2005. Unfortunately, it took over all of the file associations. There is
an option in Visual Studio 2005 to restore...
|
by: Nathan Sokalski |
last post by:
Visual Studio 2005 recently stopped generating the *.designer.vb files for
my *.aspx and *.ascx files. I am using Service Pack 1, and do not believe I
did anything differently than normal prior to...
|
by: Nathan Sokalski |
last post by:
Visual Studio 2005 unexpectedly stopped generating the *.designer.vb files
for *.aspx and *.ascx files. After a few days of frustration trying to fix
this, I noticed that it had the following...
|
by: fischermx |
last post by:
Environment:
Microsoft Visual Studio 2005
Version 8.0.50727.762 (SP.050727-7600)
Microsoft .NET Framework
Version 2.0.50727
Microsoft Visual Studio 2005 Professional Edition - ENU Service Pack...
|
by: marathoner |
last post by:
I am currently migrating my Visual C++ 6.0 applications to Visual Studio
2005. I am getting compiler errors involving the VS2005's platform SDK.
When I removed directory references to that SDK,...
|
by: raylopez99 |
last post by:
Will ASP.NET 3.0 work under Visual Studio 2005? And what is a good
newbie ASP.NET book?
Subject: Will ASP.NET 3.0 work under Visual Studio 2005? And what is a
good newbie ASP.NET book?
My...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
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...
| |