error :Method 'DocumentHTML' of object 'IDHTMLEdit' failed
hi for every one
i using program for send e-mail
and i use 'IDHTMLEdit' to load text file with message
but after i load file and run program ,compiler show following messagebox:
Run-time error'-2147418113(8000ffff)':
Method 'DocumentHTML' of object 'IDHTMLEdit' failed
i want to help me to solve problem because i want to load text file with my message .
note : i use following function :
Code:
Sub SendEmail(MailServerName As String, FromName As String,FromEmailAddress As String, ToName As String, ToEmailAddress As String, EmailSubject As String, EmailBodyOfMessage As String, htmlBody)
and use next code for sending and loading :
Code:
dlgFile.FileName = "c:\COA.log"
htmlBody.LoadDocument dlgFile.FileName
SendEmail "smtp.gmail.com", "Mohammad Ali", "[email protected]", "SADAD", "[email protected]", "Read Message", " COA", htmlBody.DocumentHTML
StatusTxt.Caption = "Mail Sent"
StatusTxt.Refresh
Close
MsgBox "COA_ ", vbExclamation, "Sending Status"