Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
551 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 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...