Solved

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

Posted on 2004-10-13
2
491 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…

821 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