MAPI and calendars |
Post Reply |
Author | |
Fabrice
Groupie Joined: 05 December 2006 Status: Offline Points: 16 |
Post Options
Thanks(0)
Posted: 16 February 2009 at 8:46am |
Hi !
Is there a way to open a calendar of another person with the fonction "SetDataProvider" ?
If yes, what is the connection string ? Sample : I would find a way to open another calendar : CalendarControl.SetDataProvider("Provider=MAPI;nickname=henry"); Thanks
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
MAPI provider is part of Outlook. How you get Outlook-protected data from another account? I am not sure that this is easy or possible!?
|
|
Fabrice
Groupie Joined: 05 December 2006 Status: Offline Points: 16 |
Post Options
Thanks(0)
|
Today, each user can read all calendars on exchange server. Why cannot I do it with the ActiveX ?
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
You right - if your users share their calendars with others
|
|
Fabrice
Groupie Joined: 05 December 2006 Status: Offline Points: 16 |
Post Options
Thanks(0)
|
Yes, all users share their calendars with others.
So, what's the connection string to connect another calendar ?
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
"Provider=MAPI;Data Source=" & Path & "\Application Data\Microsoft\Outlook\outcmd.dat" Just specify path to other user's outlook data e.g. "C:\Documents and Settings\YourUser\Local Settings" |
|
Fabrice
Groupie Joined: 05 December 2006 Status: Offline Points: 16 |
Post Options
Thanks(0)
|
I'm afraid that it can't work. The connection string doesn't work with a path like \\server\sharefolder\...
Another idea ?
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Could you give us error code you get in this case please. Could you browse to same url (\\server\sharefolder\... )
May be this is network setup/access problem?
P.S. Looks like this is a question to your network admin
|
|
Fabrice
Groupie Joined: 05 December 2006 Status: Offline Points: 16 |
Post Options
Thanks(0)
|
No error in this case, but it always open my own outlook calendar ...
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Please explain: No error in this case, but it always open my own outlook calendar
Do you access network drive or local drive?
|
|
Fabrice
Groupie Joined: 05 December 2006 Status: Offline Points: 16 |
Post Options
Thanks(0)
|
My own calendar is on a local drive. I don't have to write the path of my ressource in the connection string, simply : CalendarControl.SetDataProvider("Provider=MAPI");
Others calendars are somewhere on the network, I don't know where, and I think that's it's possible to connect to them like Outlook do.
Every connection string I've tested which starts with ("Provider=MAPI...") connect every time my own calendar. I've done a test with your sample "Provider=MAPI;Data Source=" & Path & "\Application Data\Microsoft\Outlook\outcmd.dat", where "Path" is a network path, but it doesn't work too.
Is anybody success to connect a calendar of another person with the ActiveX ?
|
|
Fabrice
Groupie Joined: 05 December 2006 Status: Offline Points: 16 |
Post Options
Thanks(0)
|
Is there anybody ?
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
I made successfull test with MAPI today. You need to make Outlook to be your default program for e-mail, contact and Calendar (check Outlook options!) and RUN Outlook while you running our MFC or VB Calendar.
Open in Outlook remote file \\MyServer\MyFolder\MyOutlook.pst - Outlook will read it and create extra PersonalFolders tree item.
You can rename it as you wich - e.g. YourPersonalFolders
use in VB Load frmMain Private Sub Form_Load() function line:
OpenProvider cjCalendarData_MAPI, "Provider=MAPI;Data Source=\\MyServer\MyFolder\MyOutlook.pst"
Now you can see your event and modify it from MFC or VB app
Btw - I am running VPN, I am in Montreal, \\MyServer\MyFolder\MyOutlook.pst - in USA
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
Additional MAPI parameters are supported for data provider connection string:
mapiProfileName= <as string>
mapiPassword= <as string> mapiFlags= <as hex number, like 0x001> EXAMPLE:
strConnEx = "Provider=MAPI; mapiProfileName=Outlook2; mapiPassword =Brawn256; mapiFlags=0x00000012" if you do not specify any parameter - default values will be used:
NULL for ProfileName and Password and MAPI_LOGON_UI for Flags Below are values which can be used for mapiFlags.
See also documentation for MAPILogonEx function. MAPI_LOGON_UI 0x00000001 /* Display logon UI */
MAPI_NEW_SESSION 0x00000002 /* Don't use shared session */ MAPI_ALLOW_OTHERS 0x00000008 /* Make this a shared session */ MAPI_EXPLICIT_PROFILE 0x00000010 /* Don't use default profile */ MAPI_EXTENDED 0x00000020 /* Extended MAPI Logon */ MAPI_FORCE_DOWNLOAD 0x00001000 /* Get new mail before return */ MAPI_SERVICE_UI_ALWAYS 0x00002000 /* Do logon UI in all providers */ MAPI_NO_MAIL 0x00008000 /* Do not activate transports */ MAPI_PASSWORD_UI 0x00020000 /* Display password UI only */ MAPI_TIMEOUT_SHORT 0x00100000 /* Minimal wait for logon resources */ (this is a copy from old - 2008 - answer)
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |