powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Microsoft Office [игнор отключен] [закрыт для гостей] / Список адресатов при рассылке на автомате
1 сообщений из 1, страница 1 из 1
Список адресатов при рассылке на автомате
    #36323143
andrey1981
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Друзья,

подскажите как прописать в адресе рассылки через CDO не одиночный адресат а distribution list

Код выглядит так


Dim oMSG
Dim oConfig
Dim CFields
Dim strBody
Dim da As String
Dim ans
Dim ArcName As String
Dim AFileName As String
Dim hwnd As Long
Dim distrlist As String



distrlist = "Water"

da = ThisWorkbook.Sheets("Summary").Cells(7, 1)


AFileName = "C:\Databases\DSRreportready\November'09\DSR as of " & da & ".xls"
ArcName = Left(AFileName, Len(AFileName) - 3) & "rar"
ans = ShellExecute(Application.hwnd, "open", "C:\Program files\WinRAR\rar.exe", "a -m5 -ep """ & ArcName & """ """ & AFileName & """", "", SW_SHOW)
Application.Wait (Now + TimeValue("0:00:03"))


Set oMSG = CreateObject("CDO.Message")


Set oConfig = CreateObject("CDO.Configuration")
Set CFields = oConfig.Fields
Set oMSG.Configuration = oConfig
CFields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
CFields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smpt.m.ru"
CFields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
CFields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "aaaaaa"
CFields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "bbbbb"
CFields("urn:schemas:mailheader:content-language") = "windows-1251"
CFields.Update

oMSG.To = "andrey@m.ru"
oMSG.CC = ""
oMSG.From = "Daily<andrey.noev@m.ru"
oMSG.Subject = "DSR as of " & da
oMSG.BodyPart.Charset = "windows-1251"
oMSG.AddAttachment ArcName


strBody = "ldldldldld"
oMSG.HTMLBody = strBody

'oMSG.display

oMSG.send

Set CFields = Nothing
Set oConfig = Nothing
Set oMSG = Nothing

именно эта процедура нужна.

Спасибо
...
Рейтинг: 0 / 0
1 сообщений из 1, страница 1 из 1
Форумы / Microsoft Office [игнор отключен] [закрыт для гостей] / Список адресатов при рассылке на автомате
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]