Am Mon, 21 Aug 2006 21:41:02 -0700 schrieb Ariel:
Thatīs really weird. Just to be su Please replace the constant
olFolderJunk by its value (23).
Did you try the mentioned GetFolder function? What happens if you pass the
path?
--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
--
www.VBOffice.net --
Hi Ken,
I placed the routine in ThisOutlookSession and got the same error as
always
"Could not complete the operation. One or more parameter values are
not valid."
There is a Junk folder and it is sub folder under Personal Folders, so I
don't understand why this is not working :-(
Thanks for your help...
Ariel
"Ken Slovak - [MVP - Outlook]" wrote:
Take this code and place it either in ThisOutlookSession or in a code
module. Place your cursor in the procedure and press F5 to run it. Report
back what happens.
Public Sub DeleteAllJunk()
Dim oFolder As Outlook.MAPIFolder
Dim colItems As Outlook.Items
Dim oItem As Object
Dim i As Long
Set oFolder = Application.Session.GetDefaultFolder(olFolderJunk)
Set colItems = oFolder.Items
If colItems.Count 0 Then
For i = colItems.Count To 1 Step -1
Set oItem = colItems.Item(i)
oItem.Delete
Next i
End If
End Sub
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"Ariel" wrote in message
...
I got the same error.