May 17, 2000 10:28 AM

Working with an Item

Rating: (0)
Windows IT Pro
InstantDoc ID #8783
In my Outlook VBA on Demand columns, I've worked mostly with Microsoft Outlook's application-level events. These events let you write code that reacts to new or sent items or to reminders that different items might trigger. However, you often need to apply some code against a specific Outlook item—either a selected item in the folder or an item you have open on your screen. Therefore, I want to show you how to use Outlook's ActiveWindow object to build a GetCurrentItem() function that always returns the selected item, whether you're looking at an open Outlook item or an Outlook folder.

Thi...

ARTICLE TOOLS

You must be a paid Professional Member to access this entire article.

Already a Professional Member? Please log in now:

NOT A PROFESSIONAL MEMBER? YOU CHOOSE:

Monthly or Annual

Professional Membership

VIP Membership

Compare Member Benefits

Add a Comment

Hello Sue,
Great stuff. I do have a question though: I would like a user to be prompted to select a mail item, which would then be attached to a message generated through code (the host app is ACCESS 2003). I know how to get a users input for attaching a file from a network for example, but don't know how to interrupt the code with an outlook explorer window which would allow the user to select a mail item, after which the code would resume its course. I don't need an extensive explanation (for which I'm sure you don't have the time), but would really appreciate if you could put me on the right track.

Many thanks in advance,
Stefan.

Anonymous User 3/3/2005 8:06:16 AM


Sue your articles are great - you really know your stuff. I've got one question I can't seem to find the answer to anywhere: how to I get at the Notes field (the one on the standard contact form) ContactItem in VBA?
Thanks
Justin


Anonymous User 1/31/2005 5:34:32 PM


Sue, you write excellent articles and very clever code and are obviously brilliant. But reading it makes my blood boil; that Microsoft has unleashed the twin evils of Outlook and VBA on an unsuspecting world. Just stand back and ask oneself whether any of this really makes sense or is even logical. What a waste of everyone's efforts!

Robert5/26/2004 3:37:02 PM


Chris, if you're not running the code in Outlook VBA (i.e. the focus of this series of articles), you'd need to use the literal values for those constants or add a library reference, depending on the coding environment.

Sue Mosher 3/3/2004 7:49:27 AM


Tom, yes, that works, because Item is an intrinsic object when you're writing code behind an Outlook form (as is Application).

Sue Mosher 3/3/2004 7:48:29 AM


Great introduction and jump start to understanding the basics of Explorer v. Inspector application programming. Helped bring to light the understanding I was needing!

David K. Baker 1/19/2004 10:34:11 PM


It seems to work to reference "Item" as the currect email item when writing code in the "Message" form. Example:

MsgBox "Sending to: " + Item.To

Is this an acceptable technique?

Thanks

Tom Sage 1/9/2004 9:11:21 AM


Listing 1 contains several undefined constants for the value of ActiveWindow.Class

Chris Kinsman 1/8/2004 9:23:24 AM


Dave, it is not possible to obtain any information from Outlook as to what day the user may have selected in the calendar.

Sue Mosher 8/27/2003 12:24:23 PM


Does anyone have an idea, how to work out what the currently selected calendar is ?

So that I can hit a macro button an assign a repatitve appoinjtment to the currently SELECTED day.

Which is not the current actual day.

Thanks

Dave Crawford 10/16/2002 10:33:32 AM


You must log on before posting a comment.

Are you a new visitor? Register Here

windows server 2008 login scripts

I have 2 win2k8 servers one pdc and bdc. The domain is exampledom.com They are connected to 2 iscsi luns which replicate each other. We are running ac...222-96118

advertisement

GOOGLE LINKS
SPONSORED LINKS
FEATURED LINKS

White Papers

Your remote offices contain valuable electronic data – are they adequately protected? Learn how proven technologies can reliably and cost-effectively back up a branch office from a central location, in real time, to disk or tape, and even utilize existing backup solutions.

Downloads

PacketTrap IT is a comprehensive and affordable network management and application monitoring solution that solves problems associated with bandwidth, network and application performance, and connectivity. Gain insight into your network - try PacketTrapIT free for 21 days!

Web Seminars

IT administrators have to solve a myriad of problems. This web seminar outlines the ten most common systems management pains - including managing highly distributed systems and dealing with data theft/loss – and the best practices to address each.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.