|
-
Feb 7th, 2005, 11:39 PM
#1
Thread Starter
Hyperactive Member
can somebody tell me why (RESOLVED)
can somebody try and explain why I can only add a maximum of 7 files at a time using this code
thanks
VB Code:
Private Sub Command1_Click()
Dim i As Integer
ProgressBar1.min = 0
'ProgressBar1.Max = 100
ProgressBar1.Value = 0
ProgressBar1.Scrolling = ccScrollingSmooth
Dim strFile() As String, strPath As String
Dim n As Long, nCount As Long
On Error Resume Next
With CommonDialog1
.Flags = cdlOFNAllowMultiselect + cdlOFNExplorer
.CancelError = True
.InitDir = "C:\"
.DialogTitle = "Select File To Add To Playlist"
.ShowOpen
If Err.Number <> cdlCancel Then
strFile = Split(.FileName, vbNullChar)
nCount = UBound(strFile)
If nCount = 0 Then
'Only one file is selected so split up the path and the filename
ReDim strFile(1)
strFile(0) = Left$(.FileName, InStrRev(.FileName, "\"))
strFile(1) = Mid$(.FileName, InStrRev(.FileName, "\") + 1)
nCount = 1
End If
strPath = strFile(0)
If Right$(strPath, 1) <> "\" Then
strPath = strPath & "\"
End If
ProgressBar1.Max = nCount
For n = 1 To nCount
If Len(Dir(FAVORITES_FOLDER & strFile(n))) = 0 Then
FileCopy strPath & strFile(n), FAVORITES_FOLDER & strFile(n)
End If
ProgressBar1.Value = nCount
Next
End If
End With
End Sub
Last edited by robvr6; Feb 8th, 2005 at 12:34 AM.
Reason: resolved
-
Feb 8th, 2005, 12:02 AM
#2
Re: can somebody tell me why
Try...
VB Code:
.Flags = cdlOFNAllowMultiselect Or cdlOFNExplorer Or cdlOFNLongNames
Also, what is the length or your 7 file names that are selected? Try varing the files selected too. Just a hunch.
Edit: I forgot to tell you "Why"
Last edited by RobDog888; Feb 8th, 2005 at 12:09 AM.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 8th, 2005, 12:19 AM
#3
Thread Starter
Hyperactive Member
Re: can somebody tell me why
Thanks for reply,they are all quite short because they are mp3 files
-
Feb 8th, 2005, 12:21 AM
#4
Re: can somebody tell me why
is it a limit of winamp? can you add more by hand?
-
Feb 8th, 2005, 12:24 AM
#5
Re: can somebody tell me why
The commond dialog object only returns a maximum of 260 characters in the FileName property. Maybe you should build your own dialog using the File listbox instead?
-
Feb 8th, 2005, 12:33 AM
#6
Thread Starter
Hyperactive Member
Re: can somebody tell me why
what RobDog888 suggested worked because I just manged to add 20 which is quite ample.
Thanks very much for the replies
R
-
Feb 8th, 2005, 12:38 AM
#7
Re: can somebody tell me why (RESOLVED)
Was it the + 'ing of the flags or the cdlOFNLongNames flag? I read somewhere
that you needed the longfilenames flag with that combination.
Either way, glad my suggestion worked.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
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
|