473,320 Members | 1,744 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

VB equivalent in Studio 2005 - FollowHyperlink (opening files)

df
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
Sep 5 '06 #1
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

Sep 5 '06 #2
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

Sep 5 '06 #3
df
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


Sep 5 '06 #4

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

Similar topics

1
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...
0
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...
0
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?
6
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...
1
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...
1
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...
0
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...
0
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,...
6
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...
0
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...
0
isladogs
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...
0
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...
0
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...
1
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)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
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
0
isladogs
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...

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.