MAPI gone in Outlook 2007?

B

Brian Hampson

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?
 
S

Sue Mosher [MVP-Outlook]

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

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
K

Ken Slovak - [MVP - Outlook]

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.




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

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
B

Brian Hampson

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?
 
S

Sue Mosher [MVP-Outlook]

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.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top