<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; CDO.Message: Отправка файла]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=8090</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=8090&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «CDO.Message: Отправка файла».]]></description>
		<lastBuildDate>Wed, 20 Feb 2013 09:40:36 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: CDO.Message: Отправка файла]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=69657#p69657</link>
			<description><![CDATA[<p><strong>badik</strong><br />Спасибо! Заработало!<br />я и подумать не мог, что это может влиять</p>]]></description>
			<author><![CDATA[null@example.com (Домовой)]]></author>
			<pubDate>Wed, 20 Feb 2013 09:40:36 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=69657#p69657</guid>
		</item>
		<item>
			<title><![CDATA[Re: CDO.Message: Отправка файла]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=69634#p69634</link>
			<description><![CDATA[<p>Отсутствует тело сообщения<br />&nbsp; &nbsp;<strong> objMessage.Textbody = &quot;mymy&quot;</strong><br />без него размер прикрепленного файла 12 байт </p><div class="codebox"><pre><code>Function CDOMessage(varAddress, objFile)
    Dim objMessage
    Set objMessage = CreateObject(&quot;CDO.Message&quot;)
    objMessage.Configuration.Fields.Item(&quot;http://schemas.microsoft.com/cdo/configuration/sendusing&quot;) = 2
    objMessage.Configuration.Fields.Item(&quot;http://schemas.microsoft.com/cdo/configuration/smtpserver&quot;) = &quot;xx.xx.xx.x&quot; &#039;strSmtpServer
    objMessage.Configuration.Fields.Item(&quot;http://schemas.microsoft.com/cdo/configuration/smtpserverport&quot;) = 25 &#039; strSmtpPort
    objMessage.BodyPart.Charset =&quot;windows-1251&quot;
    objMessage.Subject = &quot;Мониторинг ПК ПВД&quot;
    objMessage.Textbody = &quot;mymy&quot;
    objMessage.From = &quot;no-reply@xxx.ru&quot;
    objMessage.To = varAddress 
    objMessage.AddAttachment objFile
    objMessage.Configuration.Fields.Update
    objMessage.Send
End Function </code></pre></div>]]></description>
			<author><![CDATA[null@example.com (badik)]]></author>
			<pubDate>Tue, 19 Feb 2013 12:38:41 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=69634#p69634</guid>
		</item>
		<item>
			<title><![CDATA[Re: CDO.Message: Отправка файла]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=69608#p69608</link>
			<description><![CDATA[<div class="codebox"><pre><code>Option Explicit

Dim fso
Dim fil
Dim WshShell
Dim CurDir
Dim objExcel
Dim objWorkBook

Set WshShell = WScript.CreateObject(&quot;WScript.Shell&quot;)
CurDir=WshShell.CurrentDirectory
Set objExcel = CreateObject(&quot;Excel.Application&quot;) 
Set objWorkBook = objExcel.Workbooks.Open(CurDir &amp; &quot;\MonitorPVD.xlt&quot;)

objExcel.range(&quot;B16&quot;)=&quot;Некоторые данные&quot;
objExcel.range(&quot;B19&quot;)=&quot;Иные данные&quot;
objExcel.DisplayAlerts=False
objExcel.ActiveWorkbook.SaveAs CurDir &amp; &quot;\MonitorPVD.xls&quot;
objExcel.Quit

Set objExcel=Nothing
Set fil=Nothing
Set fso=Nothing
CDOMessage &quot;MyAddress@yyyyy.ru&quot;, CurDir &amp; &quot;\MonitorPVD.xls&quot;

&#039;************************************************************
Function CDOMessage(varAddress, objFile)
    Dim objMessage
    Set objMessage = CreateObject(&quot;CDO.Message&quot;)
    objMessage.Configuration.Fields.Item(&quot;http://schemas.microsoft.com/cdo/configuration/sendusing&quot;) = 2
    objMessage.Configuration.Fields.Item(&quot;http://schemas.microsoft.com/cdo/configuration/smtpserver&quot;) = &quot;xx.xx.xx.x&quot; &#039;strSmtpServer
    objMessage.Configuration.Fields.Item(&quot;http://schemas.microsoft.com/cdo/configuration/smtpserverport&quot;) = 25 &#039; strSmtpPort
    objMessage.BodyPart.Charset =&quot;windows-1251&quot;
    objMessage.Subject = &quot;Мониторинг ПК ПВД&quot;
    objMessage.From = &quot;no-reply@xxx.ru&quot;
    objMessage.To = varAddress 
    objMessage.AddAttachment objFile
    objMessage.Configuration.Fields.Update
    objMessage.Send
End Function</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Домовой)]]></author>
			<pubDate>Mon, 18 Feb 2013 09:13:44 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=69608#p69608</guid>
		</item>
		<item>
			<title><![CDATA[Re: CDO.Message: Отправка файла]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=69605#p69605</link>
			<description><![CDATA[<p><strong>Домовой</strong>, всё-таки покажите, на всякий случай, весь код.</p>]]></description>
			<author><![CDATA[null@example.com (alexii)]]></author>
			<pubDate>Mon, 18 Feb 2013 08:11:32 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=69605#p69605</guid>
		</item>
		<item>
			<title><![CDATA[CDO.Message: Отправка файла]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=69603#p69603</link>
			<description><![CDATA[<p>Доброго Всем времени суток!<br />Помогите разобраться с проблемой отправки файла. Есть шаблон Excel. Записываю в него кое-какие данные, сохраняю под новым именем. Отправляю его при помощи CDO.Message<br />Письмо приходит, файл прикреплён, однако открыть его не могу. Вываливается сообщение &quot;Документ поврежден и не может быть открыт&quot;.<br />Процедура отсылки письма<br /></p><div class="codebox"><pre><code>Function CDOMessage(varAddress, strPathFile)
    Dim objMessage
    Set objMessage = CreateObject(&quot;CDO.Message&quot;)
    objMessage.Configuration.Fields.Item(&quot;http://schemas.microsoft.com/cdo/configuration/sendusing&quot;) = 2
    objMessage.Configuration.Fields.Item(&quot;http://schemas.microsoft.com/cdo/configuration/smtpserver&quot;) = &quot;xx.xx.xxxx.x&quot; 
    objMessage.Configuration.Fields.Item(&quot;http://schemas.microsoft.com/cdo/configuration/smtpserverport&quot;) = xx
    objMessage.BodyPart.Charset =&quot;windows-1251&quot;
    objMessage.Subject = &quot;Мониторинг ПВД&quot;
    objMessage.From = &quot;no-reply@yyyy.ru&quot;
    objMessage.To = varAddress 
    objMessage.AddAttachment strPathFile
    objMessage.Configuration.Fields.Update
    objMessage.Send
End Function
</code></pre></div><p>сам созданный файл прекрасно открывается. объектные переменные уничтожаю ДО отправки письма, т.е. файл ничто не держит...</p><p>Спасибо!</p>]]></description>
			<author><![CDATA[null@example.com (Домовой)]]></author>
			<pubDate>Mon, 18 Feb 2013 08:02:41 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=69603#p69603</guid>
		</item>
	</channel>
</rss>
