Archive property of mail item

R

Ray

I have created the following code to read the subject from mail in the
Folder called MyHistory ( a sub folder of Inbox)

Sub CheckAutoArchive()
Dim objH As MAPIFolder, objItems As Outlook.Items
Dim objItem As Outlook.MailItem
Dim x, y, Ans
Set objG =
Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Folders("My
History")
Set objItems = objH.Items
For Each objItem In objItems
Ans = objItem.Subject
Debug.Print Ans
Next
End Sub

I cannot figure out how to read or set the "Do Not AutoArchive this item"
property which is in the "File, Properties" dialog box.

Can anyone help?

Thanks

Ray Hobby
 
M

Michael Bauer

Hi Ray,
I cannot figure out how to read or set the "Do Not AutoArchive this item"
property which is in the "File, Properties" dialog box.

it´s the NoAging-Property.
 
R

Ray

I have numersous items in a folder "A" which is a sub folder of inbox.
I have used the code:

Sub SetAutoArchive()
Dim objG As MAPIFolder, objItems As Outlook.Items
Dim objItem As Outlook.MailItem
Set objG =
Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Folders("A"
)
Set objItems = objG.Items
For Each objItem In objItems
objItem.NoAging = True
Next
End Sub

This does not change the autoarchive property, but does change the noaging
property. I think it must be something else.

Thanks, Ray
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top