Re: Asking Advice
- From: Karl E. Peterson <karl@xxxxxxxxxx>
- Date: Tue, 08 Dec 2009 16:04:23 -0800
It happens that Nobody formulated :
"Karl E. Peterson" <karl@xxxxxxxxxx> wrote in message news:%23mMcIT6dKHA.3792@xxxxxxxxxxxxxxxxxxxxxxxI think it'll work on 98 natively, though, and 95 if IE5+ is installed. It requires Shell v5.00+.
No. IE5 doesn't update Shell32.dll. See "5.0 Shell32.dll" row here and Note 3:
Shell and Common Controls Versions
http://msdn.microsoft.com/en-us/library/bb776779(VS.85).aspx
The notes talk about several DLL's, which makes it confusing to read. In this case, only look for what it says about Shell32.dll, which is where that function is implemented.
Hmmmm, you're right. I was thinking shlwapi. <grumble>
Anyway, one could easily make a For loop scanning backward and look for "\" and use GetAttr() and MkDir to make a pure VB solution.
Okay, gonna toss this one out to see who can shoot it down quickest...
Public Function MkDirs(ByVal Folder As String) As Boolean
Dim f() As String
Dim attr As Long
Dim i As Long
' Split incoming folder into subfolders.
f = Split(Folder, "\")
For i = 1 To UBound(f)
f(i) = f(i - 1) & "\" & f(i)
Next i
On Error Resume Next
For i = 0 To UBound(f)
' Check if this level already exists.
attr = GetAttr(f(i))
If Err.Number Then
' Folder likely doesn't exist,
' clear error and create.
Err.Clear
MkDir f(i)
If Err.Number Then Exit For
End If
Next i
' Return success?
MkDirs = CBool(GetAttr(Folder) And vbDirectory)
End Function
I've sure seen a lot of these over the years, but I guess never saw one I liked enough to bother hanging onto. Anyone see a scenario this one wouldn't handle?
--
[.NET: It's About Trust!]
.
- Follow-Ups:
- Re: Asking Advice
- From: Nobody
- Re: Asking Advice
- From: Bob Butler
- Re: Asking Advice
- References:
- Asking Advice
- From: LondonLad
- Re: Asking Advice
- From: MikeD
- Re: Asking Advice
- From: LondonLad
- Re: Asking Advice
- From: Nobody
- Re: Asking Advice
- From: Karl E . Peterson
- Re: Asking Advice
- From: Nobody
- Re: Asking Advice
- From: Karl E . Peterson
- Re: Asking Advice
- From: Nobody
- Asking Advice
- Prev by Date: Re: Visual Basic ADODB Open Connection Make Table Query
- Next by Date: Re: Need WritePrivateProfileString replacement
- Previous by thread: Re: Asking Advice
- Next by thread: Re: Asking Advice
- Index(es):
Relevant Pages
|