求简便制作目录的软件!!
来源:百度知道 编辑:UC知道 时间:2024/06/25 02:51:30
excel用vba可达到你要的效果,前提是你的所有视频都在一个目录下
Sub aa()
Dim myDialog As FileDialog, oFile As Object, strName As String, n As Integer
Dim FSO As Object, myFolder As Object, myFiles As Object
Dim fn$
Set myDialog = Application.FileDialog(msoFileDialogFolderPicker)
n = 1
With myDialog
If .Show <> -1 Then Exit Sub
Set FSO = CreateObject("Scripting.FileSystemObject")
Set myFolder = FSO.GetFolder(.InitialFileName)
Set myFiles = myFolder.Files
For Each oFile In myFiles
strName = UCase(oFile.Name)
strName = VBA.Right(strName, 3)
If strName = "rmvb" Then
Cells(n, 1) = oFile.Name
fn = myFolder & "\" & Cells(n, 1)
Cells(n, 2) = ""
n = n + 1
End If
Next
End With
End Sub
不知你的都是什么视频,将视频文件的扩展名,列举在
If strName = "rmvb" Then
语句里即可,运行宏aa试试。