View Single Post
 
Old 07-12-2005, 04:49 PM
Eric Legault [MVP - Outlo
Guest
 
Posts: n/a
Default Re: Setting Folder Aging Properties Prob

Can you post a sample of your code?

This is some code I have for changing the auto-archive settings:

Sub ReadFolderAgingProperties()
Dim objFolder As MAPI.Folder
Dim objMessage As MAPI.Message
Dim objSession As MAPI.Session
Dim objField As MAPI.Field
Set objSession = New MAPI.Session

objSession.Logon , , , False

Set objFolder =
objSession.GetFolder(Application.ActiveExplorer.Cu rrentFolder.EntryID)
For Each objMessage In objFolder.HiddenMessages
If objMessage.Type = "IPC.MS.Outlook.AgingProperties" Then
' Change the autoarchive mode (none,default,param)
objMessage.Fields.Item(CdoPR_AUTOARCHIVE_TYPE).Val ue = 0
' Change aging properties to 14 months/weeks/days
objMessage.Fields.Item(CdoPR_AGING_PERIOD).Value = 3
' Change aging granularity to days
objMessage.Fields.Item(CdoPR_AGING_GRANULARITY).Va lue = AG_MONTHS
' Change the path to the archive file
objMessage.Fields.Item(CdoPR_AGING_PATH).Value =
"C:\Temp\archive.pst"
' Enable aging for this folder
objMessage.Fields.Item(CdoPR_AGING_ENABLED).Value = True
' Enable aging age for this folder
objMessage.Fields.Item(CdoPR_AGING_AGE_FOLDER).Val ue = True
' Update hidden message
objMessage.Update True, True
End If
Next

Set objFolder = Nothing
Set objMessage = Nothing
objSession.Logoff
Set objSession = Nothing
End Sub

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
Try Picture Attachments Wizard for Outlook! http://tinyurl.com/ckytm
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/
Reply With Quote