Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
555 views
in Technique[技术] by (71.8m points)

office365 - edit mp3 tag with VBA

I use the CddbID3Tag dll and can retrieve the tagd perfect but if i try to change them and then save nothing happens

i use this code to change the tag

in a module

Public Sub SetTagItem(ByVal Path As String, ByVal Item As TagItem, ByVal Value As String)

  Dim id3Tag As Object ' CDDBCONTROLLib.CddbID3Tag

  Set id3Tag = CreateObject("CDDBControl.CddbID3Tag")
  id3Tag.LoadFromFile Path, False
  Select Case Item

    Case Album: id3Tag.Album = Value

    Case BeatsPerMinute: id3Tag.BeatsPerMinute = Value

    Case comments: id3Tag.comments = Value

    Case Copyrightholder: id3Tag.Copyrightholder = Value

    Case Copyrightyear: id3Tag.Copyrightyear = Value

    Case FileId: id3Tag.FileId = Value

    Case Genre: id3Tag.Genre = Value

    Case ISRC: id3Tag.ISRC = Value

    Case Label: id3Tag.Label = Value

    Case LeadArtist: id3Tag.LeadArtist = Value
    
    Case Movie: id3Tag.Movie = Value
    
    Case PartOfSet: id3Tag.PartOfSet = Value

    Case Title: id3Tag.Title = Value

    Case TrackPosition: id3Tag.TrackPosition = Value

    Case Year: id3Tag.Year = Value

  End Select

  id3Tag.SaveToFile Path

  Set id3Tag = Nothing

End Sub

and than in a button

SetTagItem "m:stest.mp3", LeadArtist, "Bob Dylan"
question from:https://stackoverflow.com/questions/66060633/edit-mp3-tag-with-vba

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...