Windows Media Player 11 SDK IWMPPlaylistCollection.newPlaylist (VB and C#) 

Windows Media Player SDK banner art

Previous Next

IWMPPlaylistCollection.newPlaylist (VB and C#)

The newPlaylist method returns an IWMPPlaylist interface for a new, empty playlist in the library.

  

Parameters

bstrName

A System.String that is the name of the new playlist.

Return Value

A WMPLib.IWMPPlaylist interface for the new playlist.

Remarks

This method creates an empty playlist in the library. To fill the playlist with media items, use IWMPPlaylist.appendItem or IWMPPlaylist.insertItem.

Multiple playlists having the same name are permitted in the library. To avoid creating a duplicate playlist name with this method, use the getByName method and IWMPPlaylistArray.count to discover whether a playlist with a particular name already exists.

Leading and trailing spaces are not permitted in playlist names, and are automatically removed from the value specified for the bstrName parameter.

Before calling this method, you must have full access to the library. For more information, see Library Access.

Example Code

The following example creates a new empty playlist called "ThreeList", adds it to the playlist collection, and returns an interface to it. The AxWMPLib.AxWindowsMediaPlayer object is represented by the variable named player.

  
'  Add a new empty playlist, named ThreeList, to the playlist collection.
Dim newList As WMPLib.IWMPPlaylist = player.playlistCollection.newPlaylist("ThreeList")

FakePre-a3fa9492184a42aabff1435ad7384ccd-a72a647b05564508956575e61a4c025c

// Add a new empty playlist, named ThreeList, to the playlist collection.
WMPLib.IWMPPlaylist newList = player.playlistCollection.newPlaylist("ThreeList");

Requirements

Version: Windows Media Player 9 Series or later.

Namespace: WMPLib

Assembly: Interop.WMPLib.dll (automatically generated by Visual Studio)

See Also

Previous Next