|
-
Jul 25th, 2001, 03:13 PM
#1
Thread Starter
Lively Member
Outlook automation problem
I am trying to write an automation that will delete the deleted files in the deleted items folder in outlook.....
Here is the code.
Private Sub Command1_Click()
Dim objOutlook As New Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim objInbox As MAPIFolder
Dim objMail As MailItem
'Get the MAPI reference
Set objNameSpace = objOutlook.GetNamespace("MAPI")
'Pick up the Inbox
Set objInbox = objNameSpace.GetDefaultFolder(olFolderDeletedItems)
'Loop through the folders under the Inbox
For Each objMail In objInbox.Items
objMail.Delete
Next objMail
End Sub
I get a code error when it gets to a certain part in the folder....
Type mismatch - error 13
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|