Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

(VBA - Outlook) Getting a hook into the current appointment

Posted on 2004-10-13
2
Medium Priority
?
496 Views
Last Modified: 2008-03-06
Pretty simple...I just don't know the object model.

Here's the scenario:  

1. I open an appointment in Outlook
2. Within the appointment window that pops up, I click a custom button in my custom toolbar that activates a VBA macro
3. This macro comes up with a pointer to an object representing the OPEN appointment

I am looking for something like this:  

public sub poo()
    Dim objNS As Outlook.NameSpace
    Set objNS = Application.GetNamespace("MAPI")
    Set colCalendar = _
        objNS.GetDefaultFolder(olFolderCalendar).Items
    Set objNS = Nothing

    dim ai as appointmentitem
    set ai = colcalendar.thisdamnopenitem()
end sub
0
Comment
Question by:Snakie1066
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
jimbobmcgee earned 700 total points
ID: 12296906
Try

   set ai = Application.ActiveInspector.CurrentItem

HTH

J.
0
 

Author Comment

by:Snakie1066
ID: 12299933
That worked. Thanks much.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question