| Code level: beginner Code area: Basic Outlook Printer Friendly Version | ||
| Title: GetCurrentItem() function | ||
| Description: Many VBA macros are intended for use on the current item. To avoid writing two different macros -- one for an item selected in a folder and one for an open item -- you can use this code to return the current item from the active window. | ||
| Date: 05-Jan-2003 13:43 | ||
| Code level: beginner | ||
| Code area: Basic Outlook | ||
| Posted by: Sue Mosher | ||
| Body: |
||
| All 28comments |
| Page [ 1 2 3 Next >> ] | ||
|
|
Wayne Paschal
09-Jan-2003 18:25
Can you modify the above to select all items in the current folder? I need to find a way to select all custom task items in a Public Folder and copy them to Excel. Ideally I would like this to happen automatically every 15 minutes. Any suggestions? |
|
|
|
Sue Mosher
14-Jan-2003 21:34
The Selection collection returns the items the user has selected in the user interface. If you need all the items, there's no need to use Selection. Just loop through the Items collection for the folder using a For Each ... Next loop. |
|
|
|
Todd White
31-Aug-2003 12:10
Hi Sue, I purchased and very much enjoyed your book. I've also been checking out Slipstick.com to try to solve a problem I'm having. Perhaps you could suggest a solution for me. My company uses Outlook 2000 to recieve emails every hour from specific PC's across the country. We use the rulse wizard to forward each PC's email to its own folder and then manually check each folder each hour to see if the PC "checked" in. I'm interested an app or writing some code that can do this automatically and alert us if a specific PC fails to check in within an hour or two. Any susggestions would be greatly appreciated. |
|
|
|
Bryan Nystrom
20-May-2004 11:40
Sue, I use the code above to process the text of the current item in either a Task or Calendar object. The problem I have is if someone has the Calendar view up which also has the TaskPad displayed, and they put focus on a task in the TaskPad, I don't seem to get task item returned, but instead the calendar item. Is there a way to get the Task item from the TaskPad if it has focus? |
|
|
|
Sue Mosher
21-May-2004 07:08
No. The Selection object applies only to the Explorer window displaying the current folder. The TaskPad subwindow and its selection is not accessible programmatically. |
|
|
|
Ron Luycx
25-Oct-2004 13:21
Since this is a Function, will it work in a macro that I can put on the toolbar? I am trying to create a button that will move the selected items to a specific .pst in Outlook 2000 and think this would be useful. |
|
|
|
Sue Mosher
26-Oct-2004 12:01
This function can called in a macro to return the item that you want the macro to perform some operation on. If you wanted to process multiple selected items, you would use not this function but the ActiveExplorer.Selection collection. |
|
|
|
Baz
15-Nov-2004 09:25
Hi Sue, Used this code no problems to create a custom replyto macro. It works but I have a problem. I have a rule running that notifies me when a message arrives (notify me using a specific message). If I open the message from this dialogue, then click on my custom reply macro, the reply is not generated from that window but the item that is highlighted in the main outlook window. Is there anyway to make sure it picks up the open window? |
|
|
|
Sue Mosher
17-Nov-2004 09:07
What version of Outlook, Baz? |
|
|
|
Baz
23-Nov-2004 17:16
Sorry for the delay. 2002 SP1 I think..... |
|
| Page [ 1 2 3 Next >> ] | ||
| Post your comment name email |
