Discussion:
Create temp Profile in code? Outlook 2007
(too old to reply)
Gerry Hickman
2009-11-24 20:53:22 UTC
Permalink
Hi,

I want to be able to create a temporary Profile, Logon to this profile,
carry out some tasks, then Logoff and discard the profile, then use a
different one.

In CDO 1.2.1 this appears to be possible by using the ProfileInfo
parameter of the Logon method of the Session object

http://msdn.microsoft.com/en-us/library/ms526377(EXCHG.10).aspx

"objSession.Logon( [profileName] [, profilePassword] [, showDialog] [,
newSession] [, parentWindow] [, NoMail] [, ProfileInfo] )"

but in the Outlook 2007 object model, the Logon method of the Namespace
object looks like this

http://msdn.microsoft.com/en-us/library/bb219914.aspx

expression.Logon(Profile, Password, ShowDialog, NewSession)

There's no ProfileInfo parameter.

So why don't I just use CDO 1.2.1? Because I'm on Vista/2008/Win7 and it
says on the Microsoft site that you can't install CDO (or the MAPI
client library) on a machine that has Outlook 2007 installed.
--
Gerry Hickman (London UK)
Sue Mosher [MVP]
2009-11-24 22:02:28 UTC
Permalink
You're probably looking at the server download. The client download is at
http://www.microsoft.com/downloads/details.aspx?FamilyID=2714320d-c997-4de1-986f-24f081725d36&displaylang=en.

The third-party Outlook Redemption would be another alternative.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
Post by Gerry Hickman
Hi,
I want to be able to create a temporary Profile, Logon to this profile,
carry out some tasks, then Logoff and discard the profile, then use a
different one.
In CDO 1.2.1 this appears to be possible by using the ProfileInfo
parameter of the Logon method of the Session object
http://msdn.microsoft.com/en-us/library/ms526377(EXCHG.10).aspx
"objSession.Logon( [profileName] [, profilePassword] [, showDialog] [,
newSession] [, parentWindow] [, NoMail] [, ProfileInfo] )"
but in the Outlook 2007 object model, the Logon method of the Namespace
object looks like this
http://msdn.microsoft.com/en-us/library/bb219914.aspx
expression.Logon(Profile, Password, ShowDialog, NewSession)
There's no ProfileInfo parameter.
So why don't I just use CDO 1.2.1? Because I'm on Vista/2008/Win7 and it
says on the Microsoft site that you can't install CDO (or the MAPI client
library) on a machine that has Outlook 2007 installed.
--
Gerry Hickman (London UK)
Gerry Hickman
2009-11-24 22:49:20 UTC
Permalink
Post by Sue Mosher [MVP]
You're probably looking at the server download. The client download is at
http://www.microsoft.com/downloads/details.aspx?FamilyID=2714320d-c997-4de1-986f-24f081725d36&displaylang=en.
Thank you, that explains a lot!

I will try the client download later this week. I am assuming this is
32bit only? But what about redistribution? As they've taken it out of
the o/s, I'm assuming my app will only work on boxes that have the
client installed?

I also notice this download does not mention the MAPI client library? I
checked a clean install Vista box without Outlook installed, and I do
see a MAPI32.DLL file in windows\system32, does that mean I can create
pure MAPI client apps without the additional download?
Post by Sue Mosher [MVP]
The third-party Outlook Redemption would be another alternative.
Yes, but there's already too many variations of Outlook/Exchange stuff
from Microsoft, I just want something that will work on any Windows box
without additional downloading.
--
Gerry Hickman (London UK)
Sue Mosher [MVP]
2009-11-25 13:53:30 UTC
Permalink
IIRC, it is not redistributable, so each client would need to download and
install it.

I don't know the answer to your question about the MAPI client library. I
guess you'll just have to try it and see. Of course, if you started a new
discussion thread and explained what you're actually trying to accomplish
and why Outlook isn't part of the picture, maybe someone would be able to
make a relevant suggestion.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
Post by Gerry Hickman
Post by Sue Mosher [MVP]
You're probably looking at the server download. The client download is at
http://www.microsoft.com/downloads/details.aspx?FamilyID=2714320d-c997-4de1-986f-24f081725d36&displaylang=en.
Thank you, that explains a lot!
I will try the client download later this week. I am assuming this is
32bit only? But what about redistribution? As they've taken it out of the
o/s, I'm assuming my app will only work on boxes that have the client
installed?
I also notice this download does not mention the MAPI client library? I
checked a clean install Vista box without Outlook installed, and I do see
a MAPI32.DLL file in windows\system32, does that mean I can create pure
MAPI client apps without the additional download?
Post by Sue Mosher [MVP]
The third-party Outlook Redemption would be another alternative.
Yes, but there's already too many variations of Outlook/Exchange stuff
from Microsoft, I just want something that will work on any Windows box
without additional downloading.
Gerry Hickman
2009-11-25 21:02:09 UTC
Permalink
Post by Sue Mosher [MVP]
discussion thread and explained what you're actually trying to accomplish
and why Outlook isn't part of the picture, maybe someone would be able to
make a relevant suggestion.
Thanks for your help with this.

This part is relevant to this thread, the original question is about
using the Outlook 2007 object model to create dynamic profiles. I'm
working on a large email migration; I have to log on to many different
accounts across multiple Exchange servers in multiple forests. From
reading the Outlook 2007 developer docs, it seems I can't create dynamic
profiles in code? I started looking at the Outlook object model, as this
was recommended by Microsoft as the correct way to deal with multiple
mailboxes that reside on disparate Exchange versions.

I will try out the CDO client option later this week, but I think
Microsoft are trying to drop it and it's not true x64. I can't find
anything about future of MAPI, other than they took it out of the o/s
and you need a download (that doesn't work with Outlook installed). They
took down the MAPI samples and the COM objects are no longer registered
on Vista/Win7/2008 by default, so I can't find how we are supposed to
create full featured x64 MAPI applications for the future.
--
Gerry Hickman (London UK)
Sue Mosher [MVP]
2009-11-25 21:56:40 UTC
Permalink
No, you cannot create dynamic profiles programmatically without using a
low-level API, such as CDO, Redemption, or Extended MAPI.

There will be an x64 version of Outlook 2010; perhaps your x64 MAPI issue is
addressed there. In any case, MAPI isn't going away any time soon, as
Outlook needs it.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
Post by Gerry Hickman
Post by Sue Mosher [MVP]
discussion thread and explained what you're actually trying to accomplish
and why Outlook isn't part of the picture, maybe someone would be able to
make a relevant suggestion.
Thanks for your help with this.
This part is relevant to this thread, the original question is about using
the Outlook 2007 object model to create dynamic profiles. I'm working on a
large email migration; I have to log on to many different accounts across
multiple Exchange servers in multiple forests. From reading the Outlook
2007 developer docs, it seems I can't create dynamic profiles in code? I
started looking at the Outlook object model, as this was recommended by
Microsoft as the correct way to deal with multiple mailboxes that reside
on disparate Exchange versions.
I will try out the CDO client option later this week, but I think
Microsoft are trying to drop it and it's not true x64. I can't find
anything about future of MAPI, other than they took it out of the o/s and
you need a download (that doesn't work with Outlook installed). They took
down the MAPI samples and the COM objects are no longer registered on
Vista/Win7/2008 by default, so I can't find how we are supposed to create
full featured x64 MAPI applications for the future.
--
Gerry Hickman (London UK)
Gerry Hickman
2009-11-26 22:44:54 UTC
Permalink
Post by Sue Mosher [MVP]
No, you cannot create dynamic profiles programmatically without using a
low-level API, such as CDO, Redemption, or Extended MAPI.
Thank you for the clarification; this was also my conclusion from
reading the docs.
Post by Sue Mosher [MVP]
There will be an x64 version of Outlook 2010; perhaps your x64 MAPI issue is
addressed there.
It's unlikely the new Outlook version will support things like dynamic
profiles, I'm also not sure if Outlook is a good option for real-world
messaging apps because it assumes it's running as an interactive
process; it throws modal dialogs ON ERROR. I don't know if this can be
turned off. I remember in Access 2.0 VBA there was a way to disable
modal dialogs and handle all errors in code by setting system flags, but
I can't find this option in the Outlook 2007 object model.
Post by Sue Mosher [MVP]
In any case, MAPI isn't going away any time soon, as
Outlook needs it.
Yes, the confusion for me right now, is how to get MAPI working on
Vista/Win7/2008 (obviously I want it to work regardless of whether
Outlook is installed). I can't find any info on the Microsoft site for
these new o/s versions, other than a note saying the MAPI client library
is no longer installed on these o/s and that you can't install it if the
box has Outlook. I also can't find a valid newsgroup for client MAPI
questions, they've taken down the old platformsdk.messaging newsgroup.
--
Gerry Hickman (London UK)
Sue Mosher [MVP]
2009-11-27 02:42:22 UTC
Permalink
The microsoft.public.platformsdk.mapi newsgroup is still operational, if not
very active, but the MAPI-L mailing list at
http://peach.ease.lsoft.com/scripts/wa.exe?A0=mapi-l has always been the
main place for discussing MAPI issues.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
Post by Sue Mosher [MVP]
No, you cannot create dynamic profiles programmatically without using a
low-level API, such as CDO, Redemption, or Extended MAPI.
Thank you for the clarification; this was also my conclusion from reading
the docs.
Post by Sue Mosher [MVP]
There will be an x64 version of Outlook 2010; perhaps your x64 MAPI issue is
addressed there.
It's unlikely the new Outlook version will support things like dynamic
profiles, I'm also not sure if Outlook is a good option for real-world
messaging apps because it assumes it's running as an interactive process;
it throws modal dialogs ON ERROR. I don't know if this can be turned off.
I remember in Access 2.0 VBA there was a way to disable modal dialogs and
handle all errors in code by setting system flags, but I can't find this
option in the Outlook 2007 object model.
Post by Sue Mosher [MVP]
In any case, MAPI isn't going away any time soon, as
Outlook needs it.
Yes, the confusion for me right now, is how to get MAPI working on
Vista/Win7/2008 (obviously I want it to work regardless of whether Outlook
is installed). I can't find any info on the Microsoft site for these new
o/s versions, other than a note saying the MAPI client library is no
longer installed on these o/s and that you can't install it if the box has
Outlook. I also can't find a valid newsgroup for client MAPI questions,
they've taken down the old platformsdk.messaging newsgroup.
--
Gerry Hickman (London UK)
Gerry Hickman
2009-11-27 22:08:37 UTC
Permalink
Post by Sue Mosher [MVP]
The microsoft.public.platformsdk.mapi newsgroup is still operational, if not
very active, but the MAPI-L mailing list at
http://peach.ease.lsoft.com/scripts/wa.exe?A0=mapi-l has always been the
main place for discussing MAPI issues.
Thanks again for your excellent help. I somehow didn't see
microsoft.public.platformsdk.mapi previously. The MAPI-L list looks good
too.
--
Gerry Hickman (London UK)
Ken Slovak - [MVP - Outlook]
2009-11-29 18:53:06 UTC
Permalink
There's also microsoft.public.win32.programmer.messaging for MAPI. Dmitry
hangs out there and Stephen Griffin also answers there sometimes.

There's no difference in Outlook not being recommended for running in a
service or unattended in 2007 or 2010, you just don't do it. I have used the
server side MAPI download (32 bit) with Redemption to handle dynamic logons
scanning mailboxes, and that works nicely.
--
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
Post by Gerry Hickman
Post by Sue Mosher [MVP]
The microsoft.public.platformsdk.mapi newsgroup is still operational, if not
very active, but the MAPI-L mailing list at
http://peach.ease.lsoft.com/scripts/wa.exe?A0=mapi-l has always been the
main place for discussing MAPI issues.
Thanks again for your excellent help. I somehow didn't see
microsoft.public.platformsdk.mapi previously. The MAPI-L list looks good
too.
--
Gerry Hickman (London UK)
Loading...