Solved

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

Posted on 2004-10-13
2
488 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
2 Comments
 
LVL 16

Accepted Solution

by:
jimbobmcgee earned 175 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now