|
-
Nov 14th, 2000, 11:15 AM
#1
Thread Starter
Fanatic Member
Is it possible to send a user an address to a file using either a UNC name or drive path and have that user be able to click on that path like a hyperlink and bring the file up? Example:
\\servernmame\volume\file.filexetension
-
Nov 14th, 2000, 11:33 AM
#2
Hyperactive Member
Hmm, Not sure...
I'm not sure, but I think you can. Is this for a web app? If it is, can't you use vbScript to specify that it is a hyperlink? I know how to do it in HTML, not in VB, though:
Code:
<a href="path/name/here">Path name here</a>
I hope this helps, though. Good Luck.
-vbuser1976 
VB6 Enterprise SP6
SQL 7.0 SP2
VBScript, HTML, Javascript, C++, a little UNIX
-
Nov 14th, 2000, 12:02 PM
#3
Thread Starter
Fanatic Member
This app is not for the web I want to send a link to a file for the proper person but attach the file. I thought that if I could send a link that they just could click on and open the file it would be more convenient for them. Any other suggestions?
-
Nov 14th, 2000, 12:19 PM
#4
Thread Starter
Fanatic Member
I think that I got it, you can use the shell command to open it. Example:
Shell ("explorer " & "\\csd044\user\hartlbb\test.pdf"), vbNormalFocus
This will open explorer and then open acrobat and the file.
-
Nov 14th, 2000, 01:06 PM
#5
_______
<?>
'Using Shelldef is more appropriate as you don't have
'to hardcode the path to the applications that will open
'the file associated with your filepath/file
Code:
'
'This goes in a bas module
'
Option Explicit
'
Public Declare Function ShellEx Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As Any, _
ByVal lpDirectory As Any, ByVal nShowCmd As Long) As Long
'
Public Sub ShellDef(strFileName)
Dim x
x = ShellEx(Form1.hwnd, "open", strFileName, "", "", 1)
End Sub
'Form Event Code
'this goes in your form
'if your path or name is wrong this does not produce
'an error
Private Sub Command1_Click()
Dim strYourFileVariable As String
strYourFileVariable = "c:\my documents\myFile.txt"
ShellDef strYourFileVariable
'=====================================
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Nov 14th, 2000, 01:10 PM
#6
Member
You could always try something like this (I like it a little better than the Shell command)...
Place the following code in the declarations section of a module...
Code:
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, _
ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal _
lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Const SW_MAXIMIZE = 3
Public Const SW_MINIMIZE = 6
Public Const SW_RESTORE = 9
... and place the following code in a form...
Code:
Private Sub Command1_Click()
Dim retval As Long
' This will automatically open the document in it's associated application:
retval = ShellExecute(Form1.hWnd, "open", "\\csd044\user\hartlbb\test.pdf", "", _
"\\csd044\user\hartlbb\", SW_RESTORE)
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|