Tecnologia, programação e muito Visual FoxPro.

quinta-feira, 22 de outubro de 2009

]] XL-mania [[ Re: Tidak memapilkan MS Outlook Waring saat menggunakan method 'SendMail'

 

sekedar sharing saja,
setelah tanya mas google, saya ketemu code yang sesuai dari http://www.rondebruin.nl/sendmail.htm

"problem solved"

berikut copy coding CDO yang sudah saya modif:
Private Sub CDOEngine(aWb As Workbook, strSmtp As String, strTo As String, _
strSender As String, strSubj As String, strFile As String)
'dimodifikasi dari: http://www.rondebruin.nl/sendmail.htm
Dim iMsg As Object
Dim iConf As Object
Dim Flds As Variant, DefPath As String, Fname As String


Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1 ' CDO Source Defaults
Set Flds = iConf.Fields
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = Trim(strSmtp)
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With

DefPath = Application.DefaultFilePath
If Right(DefPath, 1) <> "\" Then
DefPath = DefPath & "\"
End If

On Error Resume Next
Fname = DefPath & strFile & ".xls"
aWb.SaveAs Fname
aWb.Close savechanges:=False
Set iMsg = CreateObject("CDO.Message")
With iMsg
Set .Configuration = iConf
.to = strTo
.Subject = strSubj
.From = Trim(strSender)
'.TextBody = strbody
.AddAttachment Fname
.Send
End With
Set iMsg = Nothing

Kill Fname
On Error GoTo 0
End Sub

__._,_.___
+-:: XL-mania ::::::::::::::::::::----------------------------------+
| Moderasi akan lambat minggu ini, momods pergi ke tempat jauh      |
| http://www.facebook.com/group.php?gid=37671048001&ref=mf          |
+-------------------------------------------------------------------+
| DILARANG : MLM, money game, OOT, iklan tanpa izin, SARA, testing, |
| pembicaraan pribadi, one line message,  melecehkan,  tidak sopan. |
+-------------------------------------------------------------------+
| Buat subjek yang kreatif, jangan : "tanya", "help", "mohon bantu" |
| Usahakan besar attachment < 200 kb. Gunakan  winzip  jika  perlu. |
+-------------------------------------------------------------------+
| Ajak teman-teman Anda bergabung dengan mengirim e-mail kosong ke  |
| XL-mania-subscribe@yahoogroups.com atau kirimkan mereka file dari |
| http://groups.yahoo.com/group/XL-mania/files/Promotion/           |
+-------------------------------------------------------------------+
| Berikan testimoni di : http://www.friendster.com/xlmania atau...  |
| http://www.xl-mania.com/2008/06/testimoni-xl-mania.html           |
+-------------------------------------------------------------------+
| Message lama ada di :                                             |
| http://groups.yahoo.com/group/XL-mania/messages [perlu yahoo id]  |
| http://www.mail-archive.com/xl-mania@yahoogroups.com              |
+-------------------------------------------------------------------+
Recent Activity
Visit Your Group
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

Yahoo! Groups

Small Business Group

Share experiences

with owners like you

Yahoo! Groups

Auto Enthusiast Zone

Passionate about cars?

Check out the Auto Enthusiast Zone.

.

__,_._,___

Nenhum comentário:

Arquivo do blog