<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBScript: работаем с OpenOffice.org через COM]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=1266&amp;type=atom" />
	<updated>2008-04-18T06:17:19Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=1266</id>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: работаем с OpenOffice.org через COM]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=10516#p10516" />
			<content type="html"><![CDATA[<p>Простейший пример вывода во Writer.<br /></p><div class="codebox"><pre><code>Set objServiceManager = CreateObject(&quot;com.sun.star.ServiceManager&quot;)
Set Stardesktop = objServiceManager.createInstance(&quot;com.sun.star.frame.Desktop&quot;)
Set doc = Stardesktop.loadComponentFromURL(&quot;private:factory/swriter&quot;, &quot;_blank&quot;, 0, Array())
For i=0 To 10
    doc.Text.End.String = i &amp; &quot;: Пример вывода&quot; &amp; vbCr
Next</code></pre></div>]]></content>
			<author>
				<name><![CDATA[The gray Cardinal]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=2</uri>
			</author>
			<updated>2008-04-18T06:17:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=10516#p10516</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[VBScript: работаем с OpenOffice.org через COM]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=9799#p9799" />
			<content type="html"><![CDATA[<p>Простейший пример работы с OpenOffice.org через COM. Скрипт запускает Calc, заполняет лист некоторыми значениями, а затем сохраняет книгу в формате MS Excel.<br />Источник - <a href="http://www.kb.mista.ru/article.php?id=180">Интеграция OpenOffice Calc с 1С 7.7</a>.<br /></p><div class="codebox"><pre><code>Set ServiceManager = CreateObject(&quot;com.sun.star.ServiceManager&quot;)
Set Desktop = ServiceManager.createInstance(&quot;com.sun.star.frame.Desktop&quot;)
arr = Array()
Set Document = Desktop.LoadComponentFromURL(&quot;private:factory/scalc&quot;, &quot;_blank&quot;, 0, arr)
Set Sheets = Document.getSheets()
Set Sheet = Sheets.getByIndex(0)
For k = 0 To 10
    Sheet.getCellByPosition(0, k).Value = k
Next

Set SaveParam = ServiceManager.Bridge_GetStruct(&quot;com.sun.star.beans.PropertyValue&quot;)
SaveParam.Name = &quot;FilterName&quot;
SaveParam.Value = &quot;MS Excel 97&quot;
ReDim arr(0)
Set arr(0) = SaveParam
Document.storeToURL &quot;file:///c:/Temp/test.xls&quot;, arr</code></pre></div>]]></content>
			<author>
				<name><![CDATA[The gray Cardinal]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=2</uri>
			</author>
			<updated>2008-03-16T08:07:09Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=9799#p9799</id>
		</entry>
</feed>
