Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / November 2006

Tip: Looking for answers? Try searching our database.

MAPI gone in Outlook 2007?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brian  Hampson - 15 Nov 2006 17:21 GMT
I recently upgraded to Outlook 2007 B2TR and have found that I can no
longer code against MAPI.DLL  It's gone :(

Using C#, I used to get the MAPI session, and from that I could change
the out of office.  No longer.  Does anyone know how to do this using
the new Microsoft.Office.Core and Microsoft.Office.Outlook DLL's that
are supposed to be the new replacements?

Here's what I had that worked until Outlook 2007 came around:

SessionClass session = new MAPI.SessionClass();
session.Logon(Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,Missing.Value,servertxt.Text+"\n"+mailboxtxt.Text);
session.OutOfOffice= !this.checkBoxIn.Checked;
session.OutOfOfficeText = this.OOOtxt.Text;
session.Logoff();

Any suggestions?
Sue Mosher [MVP-Outlook] - 15 Nov 2006 17:40 GMT
Do you mean CDO.dll? That's the MAPI class. CDO 1.21 is no longer distributed with Outlook, starting with Outlook 2007. It's available as a separate download from http://www.microsoft.com/downloads/details.aspx?familyid=2714320d-c997-4de1-986f
-24f081725d36


Most of the CDO 1.21 functionality is available from the Outlook 2007 object model using the new StorageItem and PropertyAccessor objects. Tools like Outlook Spy and MFCMAPI.exe can help you locate the right hidden items and properties. I haven't tried to programmatically modify the OOA items yet, though.

FYI, there is a newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public
.outlook.program_vba


Signature

Sue Mosher, Outlook MVP
  Author of Configuring Microsoft Outlook 2003
    http://www.turtleflock.com/olconfig/index.htm
  and Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx
 
"Brian Hampson" <brian.hampson@gmail.com> wrote in message news:1163611281.303036.273500@h48g2000cwc.googlegroups.com...

>I recently upgraded to Outlook 2007 B2TR and have found that I can no
> longer code against MAPI.DLL  It's gone :(
[quoted text clipped - 13 lines]
>
> Any suggestions?
Ken Slovak - [MVP - Outlook] - 15 Nov 2006 18:09 GMT
Stores are another major CDO collection now exposed in the OOM too.

I've done some OOF coding with Outlook 2007, it works OK.

There's no OutOfOffice or OutOfOfficeText exposed however. You have to work
with the raw properties.

For OOF state you'd use the Store.PropertyAccessor object with this proptag:

"http://schemas.microsoft.com/mapi/proptag/0x661D000B"

I'm not sure where the text is stored, it's not a property on the Store
object.

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

Do you mean CDO.dll? That's the MAPI class. CDO 1.21 is no longer
distributed with Outlook, starting with Outlook 2007. It's available as a
separate download from
http://www.microsoft.com/downloads/details.aspx?familyid=2714320d-c997-4de1-986f
-24f081725d36


Most of the CDO 1.21 functionality is available from the Outlook 2007 object
model using the new StorageItem and PropertyAccessor objects. Tools like
Outlook Spy and MFCMAPI.exe can help you locate the right hidden items and
properties. I haven't tried to programmatically modify the OOA items yet,
though.

FYI, there is a newsgroup specifically for general Outlook programming
issues "down the hall" at microsoft.public.outlook.program_vba or, via web
interface, at
http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public
.outlook.program_vba


Signature

Sue Mosher, Outlook MVP
  Author of Configuring Microsoft Outlook 2003
    http://www.turtleflock.com/olconfig/index.htm
  and Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

Brian  Hampson - 15 Nov 2006 18:19 GMT
Thanks for the quick reply Sue,

I'm pretty sure it was MAPI.dll as I have an Interop.MAPI.dll
(1.21.0.0) in my old bin directory from when it worked.

I just tried to install the CDO.... "Cannot install CDO with Exchange"
I have the Exchange Admin Tools installed :(

I had a look at the Outlook.Program_VBA but it appears to be based on
using VBA WITHIN Outlook.  I'm writing my code outside of Outlook as a
standalone app.

Has ANYONE found where the OutOfOffice is hiding in the "New World
Order" that is Outlook 2007's dlls?

> Do you mean CDO.dll? That's the MAPI class. CDO 1.21 is no longer distributed with Outlook, starting with Outlook 2007. It's available as a separate download from http://www.microsoft.com/downloads/details.aspx?familyid=2714320d-c997-4de1-986f
-24f081725d36

>
[quoted text clipped - 28 lines]
> >
> > Any suggestions?
Sue Mosher [MVP-Outlook] - 15 Nov 2006 19:00 GMT
> I had a look at the Outlook.Program_VBA but it appears to be based on
> using VBA WITHIN Outlook.

As I said, that is the main general programmability newsgroup for Outlook. You should post there, not in microsoft.public.outlook, which is for usage questions, not developer questions.

> I'm pretty sure it was MAPI.dll as I have an Interop.MAPI.dll
> (1.21.0.0) in my old bin directory from when it worked.

VS gives its own names to the PIAs it creates. The code you posted was definitely CDO 1.21 code.

> I just tried to install the CDO.... "Cannot install CDO with Exchange"
> I have the Exchange Admin Tools installed :(

Correct. They're incompatible. And while we're on the subject, CDO 1.21 is not supported in .NET languages in the first place. It might have worked for you, but it might blow up on a client.

> Has ANYONE found where the OutOfOffice is hiding in the "New World
> Order" that is Outlook 2007's dlls?

Outlook Spy shows the OOF rules themselves in the Inbox.

Signature

Sue Mosher, Outlook MVP
  Author of Configuring Microsoft Outlook 2003
    http://www.turtleflock.com/olconfig/index.htm
  and Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx
 
"Brian Hampson" <brian.hampson@gmail.com> wrote in message news:1163614750.684158.194330@f16g2000cwb.googlegroups.com...

> Thanks for the quick reply Sue,
>
[quoted text clipped - 16 lines]
>>
>> FYI, there is a newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public
.outlook.program_vba

>> "Brian Hampson" <brian.hampson@gmail.com> wrote in message news:1163611281.303036.273500@h48g2000cwc.googlegroups.com...
>> >I recently upgraded to Outlook 2007 B2TR and have found that I can no
[quoted text clipped - 14 lines]
>> >
>> > Any suggestions?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.