|
发表于 2019-3-22 01:12
来自手机
|
显示全部楼层
本帖最后由 lss001 于 2019-3-22 15:13 编辑
Sub mp3wjsxdx()’MP3文件属性读写
Dim objOLE As Object, objWMP As Object, objMedia As Object, strFn$, i%
strFn = "D:\十送红军.mp3"
Set objOLE = ActiveSheet.OLEObjects.Add(ClassType:="WMPlayer.OCX") '添加控件
Set objWMP = objOLE.Object
Set objMedia = objWMP.newMedia(strFn)
' For i = 1 To objMedia.attributeCount '读入属性
' Cells(i, 1) = objMedia.getAttributeName(i - 1)
' Cells(i, 2) = objMedia.getItemInfo(Cells(i, 1).Value)
' Next
objMedia.setItemInfo "Author", "新作者" '写入属性
objMedia.setItemInfo "Title", "新标题"
objMedia.setItemInfo "Album", "新专辑"
objOLE.Delete
End Sub
|
|