This should work I guess:
saveFolder = "C:\attachment"
For Each objAtt In itm.Attachments
stFileName = saveFolder & "\" & objAtt.DisplayName
i = 0
JumpHere:
If Dir(stFileName) = "" then
objAtt.SaveAsFile stFileName
else
i=i+1
stFileName = saveFolder & "\" & i & " - " & objAtt.DisplayName
goto Jumphere
end if
Set objAtt = Nothing
Next
Reg
Sagnik




Reply With Quote