Solved

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

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

Industry Leaders: 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

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

710 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