Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: Redemption not working :(

Geek News

Redemption not working :(
sagar.pes[ at ]gmail.com 6/16/2006 5:07:12 AM
Hi,
I am developing a small application to sync outlook contacts with
another application. I am doing it in C++ . Here is a small code
snippet that I am using


if( m_Application.CreateDispatch( "Outlook.Application" ) == 0 )
{
AfxMessageBox( "Can't launch Outlook!" );
return;
}

_NameSpace m_NameSpace = m_Application.GetNamespace("MAPI");
ISafeCurrentUser User = m_NameSpace.GetCurrentUser();
CString Address = User.GetAddress();

But the problem i am facing is that the User.GetAddress() causes the
outlook security prompt which I think, should not happen.... Can anyone
pls tell me wat I am doing wrong, plssss
Thank you....

Re: Redemption not working :(
"Ken Slovak - [MVP - Outlook]" <kenslovak[ at ]mvps.org> 6/16/2006 1:32:33 PM
None of the code you are showing is using Redemption, that's why you get the
prompt. You need to instantiate either a Redemption.RDOSession object or a
Redemption.MAPIUtils object and get the user information you want from those
objects.

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


<sagar.pes[ at ]gmail.com> wrote in message
news:1150434432.688776.270900[ at ]r2g2000cwb.googlegroups.com...
[Quoted Text]
> Hi,
> I am developing a small application to sync outlook contacts with
> another application. I am doing it in C++ . Here is a small code
> snippet that I am using
>
>
> if( m_Application.CreateDispatch( "Outlook.Application" ) == 0 )
> {
> AfxMessageBox( "Can't launch Outlook!" );
> return;
> }
>
> _NameSpace m_NameSpace = m_Application.GetNamespace("MAPI");
> ISafeCurrentUser User = m_NameSpace.GetCurrentUser();
> CString Address = User.GetAddress();
>
> But the problem i am facing is that the User.GetAddress() causes the
> outlook security prompt which I think, should not happen.... Can anyone
> pls tell me wat I am doing wrong, plssss
> Thank you....
>

Re: Redemption not working :(
sagar.pes[ at ]gmail.com 6/21/2006 5:21:38 AM
Hi Ken,
thank you very much for thr prompt reply. Now I understand that I need
to instantiate either MAPIUtils or the RDOSession object. But I din't
understand to wat to initialse them with. Redemption says :

There are several ways to log on to a MAPI session in RDO:

* set the RDOSession.MAPIOBJECT property to an instance of the
IMAPISession Extended MAPI object. IMAPISession can be retrieved either
through Extended MAPI using the MAPILogonEx function, Outlook Object
Model (Namespace.MAPIOBJECT property in Outlook 2002 and up) or CDO
1.21 (Session.MAPIOBJECT property)

* RDOSession.Logon method, which takes several parameters,
including the MAPI profile name (pass an empty string to use the
default MAPI profile)

But I am using Outlook2003 OOM and C++. And I din't find any
property named MAPIOBJECT in Namespace. Also the function
RDOSession.LogOn() expects arguments of the type VARIANT. So i will be
greatful to you if you please give me some code sample to logon to
RDOSession or initialise MAPIUtils.
Thank you again..

Re: Redemption not working :(
"Ken Slovak - [MVP - Outlook]" <kenslovak[ at ]mvps.org> 6/21/2006 1:32:43 PM
If Outlook is already running something like this works:

oSession.Logon "", "", False, False

NameSpace.MAPIOBJECT is there certainly for Outlook 2000 and later. I don't
have any earlier versions to check on running here. It's a hidden member
however of that object model. When the Object Browser is displayed
right-click somewhere in the list of properties, methods and events and
select Show Hidden Members to see it in the NameSpace object properties.

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


<sagar.pes[ at ]gmail.com> wrote in message
news:1150867298.811983.30100[ at ]r2g2000cwb.googlegroups.com...
[Quoted Text]
> Hi Ken,
> thank you very much for thr prompt reply. Now I understand that I need
> to instantiate either MAPIUtils or the RDOSession object. But I din't
> understand to wat to initialse them with. Redemption says :
>
> There are several ways to log on to a MAPI session in RDO:
>
> * set the RDOSession.MAPIOBJECT property to an instance of the
> IMAPISession Extended MAPI object. IMAPISession can be retrieved either
> through Extended MAPI using the MAPILogonEx function, Outlook Object
> Model (Namespace.MAPIOBJECT property in Outlook 2002 and up) or CDO
> 1.21 (Session.MAPIOBJECT property)
>
> * RDOSession.Logon method, which takes several parameters,
> including the MAPI profile name (pass an empty string to use the
> default MAPI profile)
>
> But I am using Outlook2003 OOM and C++. And I din't find any
> property named MAPIOBJECT in Namespace. Also the function
> RDOSession.LogOn() expects arguments of the type VARIANT. So i will be
> greatful to you if you please give me some code sample to logon to
> RDOSession or initialise MAPIUtils.
> Thank you again..
>

Re: Redemption not working :(
sagar.pes[ at ]gmail.com 6/22/2006 6:40:00 AM
Hi Ken,
Thank you again for your help. But I am absolutely new to both
outlook and not very good in c++ also. So I am still unable to proceed
ahead. I request you to please help me . I will tell you what I am
doing exactly.

I am using OOM 2003 and the application is C++ based with MFC support.
As you said, the MAPIOBJECT property is a hidden one and I was able to
see it in the VB macro editor that comes with outlook. But I am using
VC++ 6 and I was unable to view any hidden members using that. Also, I
am generating the header and implementation files for OOM using the
"class wizard- Add class from type library" (msoutl.olb) option of the
VC++ IDE. In the generated .h and .cpp files also, there was no
reference to the MAPIOBJECT property (or any other hidden properties
and methods). So when I tried to use the MAPIOBJECT property, i am
getting compiler error saying that the member is not found.
And the prototype of the RDOSession.Logon function is

void Logon(const VARIANT& ProfileName, const VARIANT& Password, const
VARIANT& ShowDialog, const VARIANT& NewSession, const VARIANT&
ParentWindowHandle, const VARIANT& NoMail);

So even here, I dont understand what parametrers to be passed. And this
is my college project and I desperately need to complete it. So Plzzz
help me. And if possible, please provide me with a code sample in
c++/MFC.
Thank you....


Ken Slovak - [MVP - Outlook] wrote:
[Quoted Text]
> If Outlook is already running something like this works:
>
> oSession.Logon "", "", False, False
>
> NameSpace.MAPIOBJECT is there certainly for Outlook 2000 and later. I don't
> have any earlier versions to check on running here. It's a hidden member
> however of that object model. When the Object Browser is displayed
> right-click somewhere in the list of properties, methods and events and
> select Show Hidden Members to see it in the NameSpace object properties.
>
> --
> 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
>
>
> <sagar.pes[ at ]gmail.com> wrote in message
> news:1150867298.811983.30100[ at ]r2g2000cwb.googlegroups.com...
> > Hi Ken,
> > thank you very much for thr prompt reply. Now I understand that I need
> > to instantiate either MAPIUtils or the RDOSession object. But I din't
> > understand to wat to initialse them with. Redemption says :
> >
> > There are several ways to log on to a MAPI session in RDO:
> >
> > * set the RDOSession.MAPIOBJECT property to an instance of the
> > IMAPISession Extended MAPI object. IMAPISession can be retrieved either
> > through Extended MAPI using the MAPILogonEx function, Outlook Object
> > Model (Namespace.MAPIOBJECT property in Outlook 2002 and up) or CDO
> > 1.21 (Session.MAPIOBJECT property)
> >
> > * RDOSession.Logon method, which takes several parameters,
> > including the MAPI profile name (pass an empty string to use the
> > default MAPI profile)
> >
> > But I am using Outlook2003 OOM and C++. And I din't find any
> > property named MAPIOBJECT in Namespace. Also the function
> > RDOSession.LogOn() expects arguments of the type VARIANT. So i will be
> > greatful to you if you please give me some code sample to logon to
> > RDOSession or initialise MAPIUtils.
> > Thank you again..
> >

Re: Redemption not working :(
sagar.pes[ at ]gmail.com 6/22/2006 10:33:37 AM
Hi Ken,
I am very sorry for troubling you. But I have a good news. I
included the _NameSpace::GetMAPIOBJECT function manually in the wrapper
classes generated and it works like a charm. Though it was a lot of
work to figure out how to do this, I am very glad that I could do it.
And I just wanted to thank you for your help. So, thank you Ken, you
are the best :)

sagar.pes[ at ]gmail.com wrote:
[Quoted Text]
> Hi Ken,
> Thank you again for your help. But I am absolutely new to both
> outlook and not very good in c++ also. So I am still unable to proceed
> ahead. I request you to please help me . I will tell you what I am
> doing exactly.
>
> I am using OOM 2003 and the application is C++ based with MFC support.
> As you said, the MAPIOBJECT property is a hidden one and I was able to
> see it in the VB macro editor that comes with outlook. But I am using
> VC++ 6 and I was unable to view any hidden members using that. Also, I
> am generating the header and implementation files for OOM using the
> "class wizard- Add class from type library" (msoutl.olb) option of the
> VC++ IDE. In the generated .h and .cpp files also, there was no
> reference to the MAPIOBJECT property (or any other hidden properties
> and methods). So when I tried to use the MAPIOBJECT property, i am
> getting compiler error saying that the member is not found.
> And the prototype of the RDOSession.Logon function is
>
> void Logon(const VARIANT& ProfileName, const VARIANT& Password, const
> VARIANT& ShowDialog, const VARIANT& NewSession, const VARIANT&
> ParentWindowHandle, const VARIANT& NoMail);
>
> So even here, I dont understand what parametrers to be passed. And this
> is my college project and I desperately need to complete it. So Plzzz
> help me. And if possible, please provide me with a code sample in
> c++/MFC.
> Thank you....
>
>
> Ken Slovak - [MVP - Outlook] wrote:
> > If Outlook is already running something like this works:
> >
> > oSession.Logon "", "", False, False
> >
> > NameSpace.MAPIOBJECT is there certainly for Outlook 2000 and later. I don't
> > have any earlier versions to check on running here. It's a hidden member
> > however of that object model. When the Object Browser is displayed
> > right-click somewhere in the list of properties, methods and events and
> > select Show Hidden Members to see it in the NameSpace object properties.
> >
> > --
> > 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
> >
> >
> > <sagar.pes[ at ]gmail.com> wrote in message
> > news:1150867298.811983.30100[ at ]r2g2000cwb.googlegroups.com...
> > > Hi Ken,
> > > thank you very much for thr prompt reply. Now I understand that I need
> > > to instantiate either MAPIUtils or the RDOSession object. But I din't
> > > understand to wat to initialse them with. Redemption says :
> > >
> > > There are several ways to log on to a MAPI session in RDO:
> > >
> > > * set the RDOSession.MAPIOBJECT property to an instance of the
> > > IMAPISession Extended MAPI object. IMAPISession can be retrieved either
> > > through Extended MAPI using the MAPILogonEx function, Outlook Object
> > > Model (Namespace.MAPIOBJECT property in Outlook 2002 and up) or CDO
> > > 1.21 (Session.MAPIOBJECT property)
> > >
> > > * RDOSession.Logon method, which takes several parameters,
> > > including the MAPI profile name (pass an empty string to use the
> > > default MAPI profile)
> > >
> > > But I am using Outlook2003 OOM and C++. And I din't find any
> > > property named MAPIOBJECT in Namespace. Also the function
> > > RDOSession.LogOn() expects arguments of the type VARIANT. So i will be
> > > greatful to you if you please give me some code sample to logon to
> > > RDOSession or initialise MAPIUtils.
> > > Thank you again..
> > >

Re: Redemption not working :(
"Ken Slovak - [MVP - Outlook]" <kenslovak[ at ]mvps.org> 6/22/2006 2:12:47 PM
I'm glad you figured it out. I couldn't have helped you with the details, I
don't do C++/MFC programming, just VB 6, VB.NET and C#.

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


<sagar.pes[ at ]gmail.com> wrote in message
news:1150972417.558780.163630[ at ]u72g2000cwu.googlegroups.com...
[Quoted Text]
> Hi Ken,
> I am very sorry for troubling you. But I have a good news. I
> included the _NameSpace::GetMAPIOBJECT function manually in the wrapper
> classes generated and it works like a charm. Though it was a lot of
> work to figure out how to do this, I am very glad that I could do it.
> And I just wanted to thank you for your help. So, thank you Ken, you
> are the best :)

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net