![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#11
|
|||
|
|||
![]()
I got the same error.
"Ken Slovak - [MVP - Outlook]" wrote: Try olFolderJunk. There is no enum member olFolderSpam. -- 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 ... Hi Michael, When walking through the code, it fails at that same line as befo Set Folder = Application.Session.GetDefaultFolder(olFolderSpam) I assume that you believe that it has to do with not finding the correct folder? Will the function you gave me tell me this? If so, how do I run this within Outlook (I am an advanced programmer in VBA for access and excel, but outlook is a different animal). Thanks for your continued support! |
Ads |
#12
|
|||
|
|||
![]()
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. |
#13
|
|||
|
|||
![]()
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. |
#14
|
|||
|
|||
![]()
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. |
#15
|
|||
|
|||
![]()
I just got the same error again.
Please tell me how to run the function. Does it need to be imbedded within a sub routine or can it be run on its own like in excel or access? "Michael Bauer [MVP - Outlook]" wrote: 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. |
#16
|
|||
|
|||
![]()
Am Mon, 21 Aug 2006 22:51:02 -0700 schrieb Ariel:
Please copy the GetFolder function into the module ThisOutlookSession. Then you can call it from within the sample Ken gave you with: Set objFolder = GetFolder("Personal Folders/Inbox") Please ensure that the path exists respectively edit the path. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- I just got the same error again. Please tell me how to run the function. Does it need to be imbedded within a sub routine or can it be run on its own like in excel or access? "Michael Bauer [MVP - Outlook]" wrote: 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. |
#17
|
|||
|
|||
![]()
Michael,
It almost sounds like something is buggered in her PST file. Maybe running ScanPST.exe a couple of times with Outlook closed and then opening Outlook with the /resetfolders switch (Start, Run dialog: outlook.exe /resetfolders) might be useful. It can't hurt and may help. Other than that it's off to OutlookSpy to see if the default Store has the correct EntryID references for the default folders. This is for the default PST file? -- 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 "Michael Bauer [MVP - Outlook]" wrote in message ... Am Mon, 21 Aug 2006 22:51:02 -0700 schrieb Ariel: Please copy the GetFolder function into the module ThisOutlookSession. Then you can call it from within the sample Ken gave you with: Set objFolder = GetFolder("Personal Folders/Inbox") Please ensure that the path exists respectively edit the path. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- |
#18
|
|||
|
|||
![]()
Am Tue, 22 Aug 2006 10:10:07 -0400 schrieb Ken Slovak - [MVP - Outlook]:
Good point, Ken. I never experienced that a default folder canīt be found. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- Michael, It almost sounds like something is buggered in her PST file. Maybe running ScanPST.exe a couple of times with Outlook closed and then opening Outlook with the /resetfolders switch (Start, Run dialog: outlook.exe /resetfolders) might be useful. It can't hurt and may help. Other than that it's off to OutlookSpy to see if the default Store has the correct EntryID references for the default folders. This is for the default PST file? |
#19
|
|||
|
|||
![]()
Michael and Ken,
I tried the function but it errored out on a type mismatch. I will run the scanPST as Michael suggests and try this again. I have Outlook Spy loaded, so if you tell me where to look for the folder code, I can try and retrieve it Thanks again, guys Ariel "Michael Bauer [MVP - Outlook]" wrote: Am Tue, 22 Aug 2006 10:10:07 -0400 schrieb Ken Slovak - [MVP - Outlook]: Good point, Ken. I never experienced that a default folder canÂīt be found. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- Michael, It almost sounds like something is buggered in her PST file. Maybe running ScanPST.exe a couple of times with Outlook closed and then opening Outlook with the /resetfolders switch (Start, Run dialog: outlook.exe /resetfolders) might be useful. It can't hurt and may help. Other than that it's off to OutlookSpy to see if the default Store has the correct EntryID references for the default folders. This is for the default PST file? |
#20
|
|||
|
|||
![]()
What line produced the error?
-- 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 ... Michael and Ken, I tried the function but it errored out on a type mismatch. I will run the scanPST as Michael suggests and try this again. I have Outlook Spy loaded, so if you tell me where to look for the folder code, I can try and retrieve it Thanks again, guys Ariel |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
download messages without deleting messages on server problem | Eric | Outlook - Installation | 1 | March 21st 06 07:21 PM |
deleting downloaded messages from newsgroups | R..VENKATARAMAN | Outlook Express | 4 | March 21st 06 05:24 AM |
Deleting messages in Outlook XP | Dean | Outlook - General Queries | 1 | March 14th 06 02:23 PM |
OE EXP. 6.0 Deleting Messages | ralphS | Outlook Express | 1 | February 15th 06 08:45 PM |
deleting messages | Shanny | Outlook Express | 3 | January 18th 06 05:44 PM |