Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
developer
active.documents
automation
binary.file_format
clipboard.dde
com.add_ins
hosting.controls
internet_other
office.sdks
officedev
officedev.other
outlook.forms
outlook.vba
smarttags
vba
web.components
  
 
date: Thu, 17 Apr 2008 06:25:15 -0700 (PDT),    group: microsoft.public.office.developer.outlook.forms        back       


Reading subject() from meeting item (Outlook2003)   
Hey folks,

Writing a program at the moment using VS2005 in C# and i've hit a bit
of a wall.
i'm trying to reference the Subject and receipients fields of the
MeetingItem in Office2003.


i've written the program so far using the extensibility option and
created an inspector for MeetingItems, but i'm still unsure as to how
i can access the data contained in a meetingItem. Any and all help is
very much appreciated,
date: Thu, 17 Apr 2008 06:25:15 -0700 (PDT)   author:   Rodge

Re: Reading subject() from meeting item (Outlook2003)   
Inspector.CurrentItem is your meeting item. Once you have that as a 
MeetingItem object just use Subject and Recipients as you would any other 
item. If there are any properties related to the appointment underlying the 
meeting that aren't exposed in the MeetingItem object use the 
GetAssociatedAppointment() method to get at that AppointmentItem.

-- 
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Rodge"  wrote in message 
news:cbada794-e0bf-4ed4-a801-51428d078c06@a22g2000hsc.googlegroups.com...
> Hey folks,
>
> Writing a program at the moment using VS2005 in C# and i've hit a bit
> of a wall.
> i'm trying to reference the Subject and receipients fields of the
> MeetingItem in Office2003.
>
>
> i've written the program so far using the extensibility option and
> created an inspector for MeetingItems, but i'm still unsure as to how
> i can access the data contained in a meetingItem. Any and all help is
> very much appreciated,
>
date: Thu, 17 Apr 2008 09:38:59 -0400   author:   Ken Slovak - [MVP - Outlook]

Re: Reading subject() from meeting item (Outlook2003)   
would that require casting the meetingItem? and to which one would I
reference when using subject()?

On Apr 17, 2:38 pm, "Ken Slovak - [MVP - Outlook]"
 wrote:
> Inspector.CurrentItem is your meeting item. Once you have that as a
> MeetingItem object just use Subject and Recipients as you would any other
> item. If there are any properties related to the appointment underlying the
> meeting that aren't exposed in the MeetingItem object use the
> GetAssociatedAppointment() method to get at that AppointmentItem.
>
> --
> Ken Slovak
> [MVP - Outlook]http://www.slovaktech.com
> Author: Professional Programming Outlook 2007
> Reminder Manager, Extended Reminders, Attachment Optionshttp://www.slovaktech.com/products.htm
>
> "Rodge"  wrote in message
>
> news:cbada794-e0bf-4ed4-a801-51428d078c06@a22g2000hsc.googlegroups.com...
>
>
>
> > Hey folks,
>
> > Writing a program at the moment using VS2005 in C# and i've hit a bit
> > of a wall.
> > i'm trying to reference the Subject and receipients fields of the
> > MeetingItem in Office2003.
>
> > i've written the program so far using the extensibility option and
> > created an inspector for MeetingItems, but i'm still unsure as to how
> > i can access the data contained in a meetingItem. Any and all help is
> > very much appreciated,- Hide quoted text -
>
> - Show quoted text -
date: Thu, 17 Apr 2008 07:04:44 -0700 (PDT)   author:   Rodge

Re: Reading subject() from meeting item (Outlook2003)   
Yes, you'd have to cast the item in the Inspector. Basically everything from 
the Interop is late bound so must be cast. You'd be best off testing 
Inspector.CurrentItem.Class for OlObjectClass.olMeetingRequest before trying 
to cast to a MeetingItem, or to enclose the cast in a try...catch block.

Since Inspector.CurrentItem is an object to test for class you would need to 
use code like this to test for class:

             try
            {
                object[] args = new Object[] { };
                Type t = thing.GetType();

                return t.InvokeMember("Class",
                    BindingFlags.Public |
                    BindingFlags.GetField |
                    BindingFlags.GetProperty,
                    null,
                    meetingItem,
                    args);
            }
            catch (SystemException ex)
            {
                // whatever
            }

Once you have the MeetingItem you should use whatever properties it has 
available. Check those in the Object Browser. Only if a property is not 
available for a MeetingItem that is available in an AppointmentItem should 
you use GetAssociatedAppointment().

-- 
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Rodge"  wrote in message 
news:4a140c3a-6424-471c-b99d-aadabed326bd@m36g2000hse.googlegroups.com...
would that require casting the meetingItem? and to which one would I
reference when using subject()?
date: Thu, 17 Apr 2008 11:24:26 -0400   author:   Ken Slovak - [MVP - Outlook]

Re: Reading subject() from meeting item (Outlook2003)   
the problem is though, I can't seem to use the inspector keyword in
the class that it's required in. My project uses 2 class files in a
single solution called Xconnect. The Inspectors are defined in a class
called connect.cs, and where I need to check them is in a class called
XMeeting.cs. Every time I use the Inspector keyword in XMeeting.cs
it'sthrowing up the following error.

'XConnect.XMeetingItem' does not contain a definition for 'Inspector'

Racking my brains trying to think of a solution to this one but to no
avail.




On Apr 17, 4:24 pm, "Ken Slovak - [MVP - Outlook]"
 wrote:
> Yes, you'd have to cast the item in the Inspector. Basically everything from
> the Interop is late bound so must be cast. You'd be best off testing
> Inspector.CurrentItem.Class for OlObjectClass.olMeetingRequest before trying
> to cast to a MeetingItem, or to enclose the cast in a try...catch block.
>
> Since Inspector.CurrentItem is an object to test for class you would need to
> use code like this to test for class:
>
>              try
>             {
>                 object[] args = new Object[] { };
>                 Type t = thing.GetType();
>
>                 return t.InvokeMember("Class",
>                     BindingFlags.Public |
>                     BindingFlags.GetField |
>                     BindingFlags.GetProperty,
>                     null,
>                     meetingItem,
>                     args);
>             }
>             catch (SystemException ex)
>             {
>                 // whatever
>             }
>
> Once you have the MeetingItem you should use whatever properties it has
> available. Check those in the Object Browser. Only if a property is not
> available for a MeetingItem that is available in an AppointmentItem should> you use GetAssociatedAppointment().
>
> --
> Ken Slovak
> [MVP - Outlook]http://www.slovaktech.com
> Author: Professional Programming Outlook 2007
> Reminder Manager, Extended Reminders, Attachment Optionshttp://www.slovaktech.com/products.htm
>
> "Rodge"  wrote in message
>
> news:4a140c3a-6424-471c-b99d-aadabed326bd@m36g2000hse.googlegroups.com...
> would that require casting the meetingItem? and to which one would I
> reference when using subject()?
date: Fri, 18 Apr 2008 01:28:16 -0700 (PDT)   author:   Rodge

Re: Reading subject() from meeting item (Outlook2003)   
Ok, I replied earlier, but its not showing up, so i'll restate my
problem.
My Solution file (XConnect) contains 2 class files, Connect.cs and
XMetting.cs.
Connect.cs contains the definitions for the Inspector wrapper and all
the inspector setting up is done in there.
Xmeeting.cs contains the method that I need to access the Inspector
from. Problem is, everytime i try and reference the inspector from
XMeeting.cs, I get the following error
'XConnect.XMeetingItem' does not contain a definition for 'Inspector'

This is the problem i'm stuck with for the tiem being. :(



On Apr 17, 4:24 pm, "Ken Slovak - [MVP - Outlook]"
 wrote:
> Yes, you'd have to cast the item in the Inspector. Basically everything from
> the Interop is late bound so must be cast. You'd be best off testing
> Inspector.CurrentItem.Class for OlObjectClass.olMeetingRequest before trying
> to cast to a MeetingItem, or to enclose the cast in a try...catch block.
>
> Since Inspector.CurrentItem is an object to test for class you would need to
> use code like this to test for class:
>
>              try
>             {
>                 object[] args = new Object[] { };
>                 Type t = thing.GetType();
>
>                 return t.InvokeMember("Class",
>                     BindingFlags.Public |
>                     BindingFlags.GetField |
>                     BindingFlags.GetProperty,
>                     null,
>                     meetingItem,
>                     args);
>             }
>             catch (SystemException ex)
>             {
>                 // whatever
>             }
>
> Once you have the MeetingItem you should use whatever properties it has
> available. Check those in the Object Browser. Only if a property is not
> available for a MeetingItem that is available in an AppointmentItem should> you use GetAssociatedAppointment().
>
> --
> Ken Slovak
> [MVP - Outlook]http://www.slovaktech.com
> Author: Professional Programming Outlook 2007
> Reminder Manager, Extended Reminders, Attachment Optionshttp://www.slovaktech.com/products.htm
>
> "Rodge"  wrote in message
>
> news:4a140c3a-6424-471c-b99d-aadabed326bd@m36g2000hse.googlegroups.com...
> would that require casting the meetingItem? and to which one would I
> reference when using subject()?
date: Fri, 18 Apr 2008 02:17:38 -0700 (PDT)   author:   Rodge

Re: Reading subject() from meeting item (Outlook2003)   
So create a public property in the Connect class that returns the Inspector 
object. Not much of a problem.

// in Connection:
private Outlook.Inspector _inspector;

public Outlook.Inspector Inspector
{
    get
    {
        return _inspector;
    }
}

// from the other class:

Outlook.Inspector myInspector = Connect.Inspector;

You could also pass an Inspector object to the other class in the class's 
constructor code, and there are any number of other ways to do what you 
want.

-- 
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Rodge"  wrote in message 
news:f494286f-2214-48ad-bdf6-04ab217b8251@y21g2000hsf.googlegroups.com...
Ok, I replied earlier, but its not showing up, so i'll restate my
problem.
My Solution file (XConnect) contains 2 class files, Connect.cs and
XMetting.cs.
Connect.cs contains the definitions for the Inspector wrapper and all
the inspector setting up is done in there.
Xmeeting.cs contains the method that I need to access the Inspector
from. Problem is, everytime i try and reference the inspector from
XMeeting.cs, I get the following error
'XConnect.XMeetingItem' does not contain a definition for 'Inspector'

This is the problem i'm stuck with for the tiem being. :(
date: Fri, 18 Apr 2008 08:57:01 -0400   author:   Ken Slovak - [MVP - Outlook]

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us