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 = "[email protected]"
frmMainIR.SMTP.SendTo = "[email protected],hbchew@s.
carsems.com.my,[email protected]"
frmMainIR.SMTP.CC = "[email protected],[email protected],
" & _
"[email protected],[email protected].
my," & _
"[email protected],[email protected]," &
_
"[email protected],[email protected].
my," & _
"[email protected],[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
 
Top