|
|
|
date: Thu, 17 Apr 2008 06:25:15 -0700 (PDT),
group: microsoft.public.office.developer.outlook.forms
back
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]
|
|