<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBScript: получение данных о коллекции аудио с передачей в Excel]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=894&amp;type=atom" />
	<updated>2007-11-27T07:29:56Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=894</id>
		<entry>
			<title type="html"><![CDATA[VBScript: получение данных о коллекции аудио с передачей в Excel]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=6420#p6420" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Set objPlayer = CreateObject(&quot;WMPlayer.OCX&quot; )

Set objMediaCollection = objPlayer.MediaCollection
Set colSongList = objMediaCollection.getByAttribute(&quot;MediaType&quot;, &quot;Audio&quot;)

Set objExcel = CreateObject(&quot;Excel.Application&quot;)
objExcel.Visible = True
Set objWorkbook = objExcel.Workbooks.Add()
Set objWorksheet = objWorkbook.Worksheets(1)

objWorksheet.Cells(1,1) = &quot;Название песни&quot;
objWorksheet.Cells(1,2) = &quot;Артист&quot;
objWorksheet.Cells(1,3) = &quot;Альбом&quot;
objWorksheet.Cells(1,4) = &quot;Длина&quot;
objWorksheet.Cells(1,5) = &quot;Количество проигрываний&quot;

j = 2

For i = 0 to colSongList.Count - 1
    Set objSong = colSongList.Item(i)
    objWorksheet.Cells(j,1) = objSong.Name
    objWorksheet.Cells(j,2) = objSong.getItemInfo(&quot;Artist&quot;)
    objWorksheet.Cells(j,3) = objSong.getItemInfo(&quot;Album&quot;)
    objWorksheet.Cells(j,4) = objSong.durationString
    objWorksheet.Cells(j,5) = objSong.getItemInfo(&quot;UserPlayCount&quot;)
    j = j + 1
Next

Set objRange = objWorksheet.UsedRange
objRange.Columns.AutoFit()</code></pre></div><p>Автор примера - <strong>Alexbootch</strong>.</p>]]></content>
			<author>
				<name><![CDATA[The gray Cardinal]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=2</uri>
			</author>
			<updated>2007-11-27T07:29:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=6420#p6420</id>
		</entry>
</feed>
