B
BlackScholes
I have a VBA script which ripes off attachment and save it onto local file
system. The script works fine usually. However it tends to disappear every
now and then randomly, which in turns cause the message rule to fail. Anyone
knows what might be the cause? Any help is appreciated.
The script i use is as follows:
Public Sub doImport(Item As Outlook.MailItem)
Dim iCtr As Integer
Dim sPathName
sPathName = "p:\onlineorder\import\pending\"
With Item.Attachments
iAttachCnt = .Count
If iAttachCnt > 0 Then
For iCtr = 1 To iAttachCnt
.Item(iCtr).SaveAsFile sPathName & .Item(iCtr).FileName
Next iCtr
End If
End With
DoEvents
SaveAttachments = True
End Sub
system. The script works fine usually. However it tends to disappear every
now and then randomly, which in turns cause the message rule to fail. Anyone
knows what might be the cause? Any help is appreciated.
The script i use is as follows:
Public Sub doImport(Item As Outlook.MailItem)
Dim iCtr As Integer
Dim sPathName
sPathName = "p:\onlineorder\import\pending\"
With Item.Attachments
iAttachCnt = .Count
If iAttachCnt > 0 Then
For iCtr = 1 To iAttachCnt
.Item(iCtr).SaveAsFile sPathName & .Item(iCtr).FileName
Next iCtr
End If
End With
DoEvents
SaveAttachments = True
End Sub