Dear All,
Is there a way to save all Excel attachments in outlook to say "H:\Excel Files\" and then save all zipped files to say "H:\zipped Files\" automatically when they are received,(all attachemnts are stored in \Inbox\Attachments\ folder) I have looked around for coding to try and help with this, but i am having great difficulty in trying to get this to work. I have some coding below which a colleague sent to me but I am really new to outlook VBA and can't get this to work,can anybody help with this, does anybody also know how to open all files received today automatically in the public folders location of the files are as follows
Public Folders\All Public Folders\Crystal Reports\Client Reports\Client\Agent Reports\Bagpuss\, the files that are in here are saved as .doc files, the subject of the file each day is sag101.rpt, i need to open today's file with this subject, and also save this file to "H:\101 Reports\"
Any help on any of this would be greatly appreciated. If anybody knows of any good sites where I can get help on this would also be appreciated.
The coding as mentioned above.
'coding not in any order
Dim WithEvents myOlApp As Outlook.Application
Sub Initialize_handler()
Set myOlApp = CreateObject("Outlook.application"
End Sub
Private Sub myOlApp_NewMail()
Dim myExplorers As Outlook.Explorers
Dim myFolder As Outlook.MAPIFolder
Set myExplorers = myOlApp.Explorers
Set myFolder = myOlApp.GetNamespace("MAPI"
.GetDefaultFolder(olFolderInbox)
If myExplorers.Count <> 0 Then
For x = 1 To myExplorers.Count
On Error GoTo skipif
If myExplorers.Item(x).CurrentFolder.Name = "Inbox" Then
myExplorers.Item(x).Display
myExplorers.Item(x).Activate
Exit Sub
End If
skipif:
Next x
End If
On Error GoTo 0
myFolder.Display
'this is my coding to save attachments
Sub Openemails()Set myOlApp = CreateObject("Outlook.Application"
Set myNameSpace = myOlApp.GetNamespace("MAPI"
Set mymails = myNameSpace.GetDefaultFolder(olFolderInbox)
Set myItem = mymails.Items.Find("[From] = ""Edwards, Clinton"""
Set myAttachments = myItem.Attachments
With myItem
.DisplayEnd WithSet myAttachments = myItem.Attachments
myAttachments.Item(1).SaveAsFile "C:\Rob\" & _ myAttachments.Item(1).DisplayNameEnd Sub
Is there a way to save all Excel attachments in outlook to say "H:\Excel Files\" and then save all zipped files to say "H:\zipped Files\" automatically when they are received,(all attachemnts are stored in \Inbox\Attachments\ folder) I have looked around for coding to try and help with this, but i am having great difficulty in trying to get this to work. I have some coding below which a colleague sent to me but I am really new to outlook VBA and can't get this to work,can anybody help with this, does anybody also know how to open all files received today automatically in the public folders location of the files are as follows
Public Folders\All Public Folders\Crystal Reports\Client Reports\Client\Agent Reports\Bagpuss\, the files that are in here are saved as .doc files, the subject of the file each day is sag101.rpt, i need to open today's file with this subject, and also save this file to "H:\101 Reports\"
Any help on any of this would be greatly appreciated. If anybody knows of any good sites where I can get help on this would also be appreciated.
The coding as mentioned above.
'coding not in any order
Dim WithEvents myOlApp As Outlook.Application
Sub Initialize_handler()
Set myOlApp = CreateObject("Outlook.application"

End Sub
Private Sub myOlApp_NewMail()
Dim myExplorers As Outlook.Explorers
Dim myFolder As Outlook.MAPIFolder
Set myExplorers = myOlApp.Explorers
Set myFolder = myOlApp.GetNamespace("MAPI"

If myExplorers.Count <> 0 Then
For x = 1 To myExplorers.Count
On Error GoTo skipif
If myExplorers.Item(x).CurrentFolder.Name = "Inbox" Then
myExplorers.Item(x).Display
myExplorers.Item(x).Activate
Exit Sub
End If
skipif:
Next x
End If
On Error GoTo 0
myFolder.Display
'this is my coding to save attachments
Sub Openemails()Set myOlApp = CreateObject("Outlook.Application"


Set myItem = mymails.Items.Find("[From] = ""Edwards, Clinton"""

Set myAttachments = myItem.Attachments
With myItem
.DisplayEnd WithSet myAttachments = myItem.Attachments
myAttachments.Item(1).SaveAsFile "C:\Rob\" & _ myAttachments.Item(1).DisplayNameEnd Sub