十分感谢守柔版主,你提供的过程真是太好了![em17]不过要是能象EXCEL返回一个对象就更好了,
expression.GetOpenFilename(FileFilter, FilterIndex, Title, ButtonText, MultiSelect),
在excel中非常高手jack。zhou是这样用的:
***************************************
Sub AddSong() '增加不重复曲目,如果只增加一曲,则立即播放
Dim x, i%, Str$
SetObject
With Application.CommandBars("Excel Player").Controls("Song")
If .ListCount > 0 Then
For i = 1 To .ListCount
Str = Str & .List(i)
Next i
End If
End With
With Application
x = .GetOpenFileName(filefilter:="All Files (*.*), *.*,Mp3 Files (*.mp3), *.Mp3", filterindex:=0, Title:="添加声音文件,按住Ctrl键可多选", MultiSelect:=True)
If IsArray(x) = False Then Exit Sub
For i = LBound(x) To UBound(x)
If InStr(Str, x(i)) = 0 Then
.CommandBars("Excel Player").Controls("Song").AddItem x(i)
If UBound(x) = 1 Then
.CommandBars("Excel Player").Controls("Song").ListIndex = .CommandBars("Excel Player").Controls("Song").ListCount
Call EP0
End If
Else
ReadMe x(i) & vbCrLf & vbCrLf & "*此曲重复,播放列表中已经存在*"
If UBound(x) = 1 Then Call AddSong
End If
Next i
End With
End Sub
'以上代码由jack.zhou,原创提供,本人在此为学习用途,如有侵权,请多包涵!
***************************
您提供的过程基本达到了目的,但使用时不是很方便,如果版主您有时间时,请帮助我!
[em06]正在研究中……
[此贴子已经被作者于2005-4-24 14:35:06编辑过] |