C
chris
Dear smart people,
I’m currently making a script that can explore folders by using the
hyperlink function of a button. The pathname to the last folder works fine,
but the last folder in the path name is the problem. The last folder is usual
the same as a value from a list box, but the users want to explore the
complete folder and add some extra information in the folder name. Like “Text
from listbox†and than some extra information. When they don’t add extra
information the hyperlink works fine but with the extra information added the
hyperlink doesn’t exist.
I have already tried to use the short DOS names but they are not logical so
I can’t put them I a script. What I really need is a solution like “*†used
in win98 but then for a VB script
Can anybody please help me out?
Thanks
Chris
'**************** set main pathname ******************
strMainpathName = "\\first path name\"
'**************** set main folder name ***********************
strmainfoldername = "03SQ" & "20" & Right(Me.Date_Received, 2) & "\" &
Me.Series
'**************** set Sub folder pathname ***************
strSubFolderName = strMainpathName & strmainfoldername
'**************** set path name quote folder *************************
strFolderName = strSubFolderName & "\" & Me.SQ_Number
'*************** to put a pathname value in vb if the path is not existing
then the string wil be "" **********
strMainpath = Dir(strMainpathName, vbDirectory)
strSubFolder = Dir(strSubFolderName, vbDirectory)
strFolder = Dir(strFolderName, vbDirectory)
If Not strSubFolder = "" Then
If Not strFolder = "" Then
'************** to open a folder ******************
Me.cmdViewFolder.HyperlinkAddress = strFolderName
Else
Msg = "The folder you are trying to open doesn't exist do you want
to create the folder" ' Define message.
Style = vbYesNo + vbQuestion + vbDefaultButton2
Title = "Create Folder" ' Define title.
response = MsgBox(Msg, Style, Title, Help, Ctxt)
If response = vbYes Then
MyString = "Yes"
'************ to create a folder ***************
MkDir (strFolderName)
Me.cmdViewFolder.HyperlinkAddress = strFolderName
Else
MyString = "No"
Me.cmdViewFolder.HyperlinkAddress = ""
End If
End If
I’m currently making a script that can explore folders by using the
hyperlink function of a button. The pathname to the last folder works fine,
but the last folder in the path name is the problem. The last folder is usual
the same as a value from a list box, but the users want to explore the
complete folder and add some extra information in the folder name. Like “Text
from listbox†and than some extra information. When they don’t add extra
information the hyperlink works fine but with the extra information added the
hyperlink doesn’t exist.
I have already tried to use the short DOS names but they are not logical so
I can’t put them I a script. What I really need is a solution like “*†used
in win98 but then for a VB script
Can anybody please help me out?
Thanks
Chris
'**************** set main pathname ******************
strMainpathName = "\\first path name\"
'**************** set main folder name ***********************
strmainfoldername = "03SQ" & "20" & Right(Me.Date_Received, 2) & "\" &
Me.Series
'**************** set Sub folder pathname ***************
strSubFolderName = strMainpathName & strmainfoldername
'**************** set path name quote folder *************************
strFolderName = strSubFolderName & "\" & Me.SQ_Number
'*************** to put a pathname value in vb if the path is not existing
then the string wil be "" **********
strMainpath = Dir(strMainpathName, vbDirectory)
strSubFolder = Dir(strSubFolderName, vbDirectory)
strFolder = Dir(strFolderName, vbDirectory)
If Not strSubFolder = "" Then
If Not strFolder = "" Then
'************** to open a folder ******************
Me.cmdViewFolder.HyperlinkAddress = strFolderName
Else
Msg = "The folder you are trying to open doesn't exist do you want
to create the folder" ' Define message.
Style = vbYesNo + vbQuestion + vbDefaultButton2
Title = "Create Folder" ' Define title.
response = MsgBox(Msg, Style, Title, Help, Ctxt)
If response = vbYes Then
MyString = "Yes"
'************ to create a folder ***************
MkDir (strFolderName)
Me.cmdViewFolder.HyperlinkAddress = strFolderName
Else
MyString = "No"
Me.cmdViewFolder.HyperlinkAddress = ""
End If
End If