L
leonid.galushko
Hi,
I have there a makro which make the same view settings from the chosen
"SOURCE FOLDER" for the chosen "TARGET FOLDER".
I want the adjastement in that way that if the "TARGET FOLDER" contains
some FOlDER more (UNDERFOlDER) like FOlDER "Mail" might contains
FOLDERS (JOB,
PRIVATE,
TO DO,
etc)
the view settings are equally changed for all this FOLDER's too. Have
somebody an idea how to adjust that makro to make it run for TARGET
FOLDER with more FOLDERS
Public Sub CopyView()
Dim TargetFolder As Outlook.MAPIFolder
Dim SourceFolder As Outlook.MAPIFolder
Set SourceFolder = Application.Session.PickFolder
If Not SourceFolder Is Nothing Then
Set TargetFolder = Application.Session.Folders(" ") ''' ???
'There are FOLDERS in the chosen FOLDER.
'TO DEFINE the chosen TargetFolder in the quotes
While Not TargetFolder Is Nothing
If TargetFolder.DefaultItemType = SourceFolder.DefaultItemType
Then
With TargetFolder.CurrentView
.XML = SourceFolder.CurrentView.XML
.Save
End With
Else
MsgBox "Source and target folder must be of the same type.",
vbInformation
End If
Set TargetFolder = Application.Session.PickFolder
Wend
End If
End Sub
I have there a makro which make the same view settings from the chosen
"SOURCE FOLDER" for the chosen "TARGET FOLDER".
I want the adjastement in that way that if the "TARGET FOLDER" contains
some FOlDER more (UNDERFOlDER) like FOlDER "Mail" might contains
FOLDERS (JOB,
PRIVATE,
TO DO,
etc)
the view settings are equally changed for all this FOLDER's too. Have
somebody an idea how to adjust that makro to make it run for TARGET
FOLDER with more FOLDERS
Public Sub CopyView()
Dim TargetFolder As Outlook.MAPIFolder
Dim SourceFolder As Outlook.MAPIFolder
Set SourceFolder = Application.Session.PickFolder
If Not SourceFolder Is Nothing Then
Set TargetFolder = Application.Session.Folders(" ") ''' ???
'There are FOLDERS in the chosen FOLDER.
'TO DEFINE the chosen TargetFolder in the quotes
While Not TargetFolder Is Nothing
If TargetFolder.DefaultItemType = SourceFolder.DefaultItemType
Then
With TargetFolder.CurrentView
.XML = SourceFolder.CurrentView.XML
.Save
End With
Else
MsgBox "Source and target folder must be of the same type.",
vbInformation
End If
Set TargetFolder = Application.Session.PickFolder
Wend
End If
End Sub