Discussion:
Copy from Search Folders to New Folder
(too old to reply)
McKilty
15 years ago
Permalink
I'm back again with another question for a never-ending, continuously
evolving project.

My boss would like me to run a routine that accesses a Search Folder,
filter's for the previous day, and then copies all the items for that
day to a new Outlook folder. This would be after that folder for that
day has been cleared.

So basically, he'll have a folder for each day of the week filled with
all the e-mails from that day.

Is this a possibility? Can I copy from the Search folder?
McKilty
15 years ago
Permalink
Ah... I used the CopyTo. Thanks you and stay tuned...
McKilty
15 years ago
Permalink
How would I delete all the items from a folder? I tried:

myNameSpace.Folders(sMailbox).Folders("Misc - EmailXtender
Searches").Folders("Temporary").Folders("Sunday")).Items.Remove

but it says argument not optional and I haven't found what the
arguments are.
Ken Slovak - [MVP - Outlook]
15 years ago
Permalink
Look in the object browser for methods/events/properties and arguments for
the methods and events. In this case Remove takes the index of the item to
be removed.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
Post by McKilty
myNameSpace.Folders(sMailbox).Folders("Misc - EmailXtender
Searches").Folders("Temporary").Folders("Sunday")).Items.Remove
but it says argument not optional and I haven't found what the
arguments are.
McKilty
15 years ago
Permalink
...
Thanks, I got it. Once again, much appreciated.

I have to remove each item separately. I think I could probably
delete the folder and recreate it, so if speed is an issue, I can do
it that way-- provided it doesn't send the folder to the Deleted Items.
Ken Slovak - [MVP - Outlook]
15 years ago
Permalink
Deleting the items will delete the originals and send them to Deleted Items.
Items aren't actually in a search folder, it just shows items that meet a
filter. So those items you "remove" will in reality be deleted.

If you delete a search folder and recreate it then it will have the same
items as it had originally as long as the same search term is used.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
Post by McKilty
myNameSpace.Folders(sMailbox).Folders("Misc - EmailXtender
Searches").Folders("Temporary").Folders("Sunday")).Items.Remove
but it says argument not optional and I haven't found what the
arguments are.
Thanks, I got it. Once again, much appreciated.

I have to remove each item separately. I think I could probably
delete the folder and recreate it, so if speed is an issue, I can do
it that way-- provided it doesn't send the folder to the Deleted Items.
McKilty
15 years ago
Permalink
...
Yeah, I understand that Search Folders are pointers more than
anything. I was referring to the folders I was moving them to. But
it doesn't take long to clear them one at a time.

Continue reading on narkive:
Loading...