We then use these two lines of code to create an instance of the Outlook.Application object and to bind to the MAPI namespace (which happens to be the only namespace we can bind to): Set objOutlook = CreateObject(“Outlook.Application”) You’re right: the script does start off simple enough, doesn’t it? We begin by defining a constant named olFolderInbox and setting the value to 6 we’ll use this constant to tell the script which Outlook folder we want to bind to. And you can get a brief introduction to recursion by taking a peek at the Microsoft Windows 2000 Scripting Guide. So, we’ll tell you what, MB: we’ll give you a script that can access all the subfolders in your Inbox, but we won’t promise that we’ll be able to explain the workings of the script in nitty-gritty detail, at least not in today’s column. On the other hand, it wouldn’t be very good form to start answering a question and then never finish answering it. (Such as editors chasing after Scripting Guys with soggy chocolate chip cookies. And, let’s face it, when you’re a Scripting Guy you have enough nightmares as it is. (In fact, we have no idea how to answer your question without using recursion.) No, the problem isn’t that recursion is useless, the problem is that recursion is an absolute nightmare to try to explain. It’s not that recursive functions and subroutines aren’t useful they are. If we were smart (yes, yes we know: that’s a big if), we’d add recursive functions and subroutines to the list of things that we should never talk about. We apologize to all of you who know how to eat cookies properly – soggy to the point where you can just barely get it to your mouth without it falling into the milk.) (Editor’s Note: In the opinion of this editor, which is really the only opinion that counts, that statement is completely inaccurate. As long as we’re on the subject, you shouldn’t dip chocolate chip cookies in milk either, at least not if you intend to drink the milk afterwards. The fact that you should never, ever put ice cream on top of cake? Forget it making a statement like that is bound to create controversy. Discuss religion in a scripting column? Not a good idea. You know, after you’ve written a daily scripting column for nearly two years (have we mentioned the Hey, Scripting Guy 500th column celebration lately?) you learn that certain subjects are strictly off-limits. Hey, Scripting Guy! How can I write a script that accesses all the subfolders in my Outlook Inbox?
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |