Method or Data Member not found

K

Kaur

Hi Everyone,

When I compile I face the above error with the word Server Highlighted in
Yellow.What could be the issue here?Can someone help me please

The Code :

Function SendQAReports()
On Error GoTo ErrorHandler


frmMainIR.SMTP.Server = "SIT-IMC"
frmMainIR.SMTP.MailFrom = "(e-mail address removed)"
frmMainIR.SMTP.SendTo = "(e-mail address removed),hbchew@s.
carsems.com.my,[email protected]"
frmMainIR.SMTP.CC = "(e-mail address removed),[email protected],
" & _
"(e-mail address removed),[email protected].
my," & _
"(e-mail address removed),[email protected]," &
_
"(e-mail address removed),[email protected].
my," & _
"(e-mail address removed),[email protected].
my"
frmMainIR.SMTP.MessageSubject = "IR Weekly Quality Report"
frmMainIR.SMTP.MessageText = vbCrLf & "Hi all," & vbCrLf & vbCrLf & _
"Kindly find IR Weekly Quality Report(s) as attached.Thanks." &
vbCrLf

Dim Tempdir As String
Dim fso As New FileSystemObject
Dim curFolder As Folder
Dim filename As String
Dim totalFiles As Integer

Tempdir = "\\itjitscheduler\AutoSendReport\Irqadata\IR- Weekly Subcon
Quality Report\Program\" & Format(Date, "YYYY") & "\" & Format(Date, "MMMdd")
'Tempdir = "\\carsemmb\irqadata\IR- Weekly Subcon Quality Report\" &
Format(Date, "YYYY") & "\" & Format(Date, "MMMdd")
lookin = Tempdir

Set curFolder = fso.GetFolder(lookin)

On Error GoTo ErrorHandler

filename = Dir(fso.BuildPath(curFolder.Path, "*.*"), vbNormal Or
vbHidden Or vbSystem Or vbReadOnly)
totalFile = 0

While Len(filename) <> 0
totalFiles = totalFiles + 1
If filename Like "*.xls" Then
frmMainIR.SMTP.Attachments.Add (curFolder.Path & "\" &
filename)
End If
filename = Dir()
Wend

frmMainIR.SMTP.SendEmail

GoTo ExitHandler

ErrorHandler:
MsgBox ("SendReportsOut : " & Err.Number & " " & Err.Description)

ExitHandler:

End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top