View Single Post
  #5  
Old March 3rd 08, 09:06 AM posted to microsoft.public.outlook.program_vba
Massimo[_2_]
external usenet poster
 
Posts: 3
Default Modify VBS Script for Outlook


MailItem.SenderAddress properties. Once you get each mail item in the loop
use those properties:

For Each objMessage in colItems
If ((objMessage.SenderName = "Joe Fubar") OR _
(objMessage.SenderAddress = ")) Then

' do whatever with this one
End If



Thank you very much but I'm ignorant about VBS :-)
how can I modify the script with the new option ?

--------------------------------------------------
Const olFolderInbox = 6
Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objFolder = objNamespace.GetDefaultFolder(olFolderInbox)
Set colItems = objFolder.Items
For Each objMessage in colItems
intCount = objMessage.Attachments.Count
If intCount 0 Then
For i = 1 To intCount
objMessage.Attachments.Item(i).SaveAsFile "C:\Temp\" & _
objMessage.Attachments.Item(i).FileName
Next
End If
Next
--------------------------------------------------

Best Regards





Ads