Print Page | Close Window

MAPI and calendars

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=13421
Printed Date: 11 May 2024 at 10:56pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: MAPI and calendars
Posted By: Fabrice
Subject: MAPI and calendars
Date 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



Replies:
Posted By: mdoubson
Date Posted: 18 February 2009 at 9:15pm
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!?

-------------
Mark Doubson, Ph.D.


Posted By: Fabrice
Date Posted: 19 February 2009 at 4:12am
Today, each user can read all calendars on exchange server. Why cannot I do it with the ActiveX ?


Posted By: mdoubson
Date Posted: 20 February 2009 at 7:05pm
You right - if your users share their calendars with others

-------------
Mark Doubson, Ph.D.


Posted By: Fabrice
Date Posted: 23 February 2009 at 4:42am
Yes, all users share their calendars with others.
 
So, what's the connection string to connect another calendar ?


Posted By: mdoubson
Date Posted: 23 February 2009 at 10:51am

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



-------------
Mark Doubson, Ph.D.


Posted By: Fabrice
Date Posted: 23 February 2009 at 11:35am
I'm afraid that it can't work. The connection string doesn't work with a path like file://\\server\sharefolder\... - \\server\sharefolder\...
 
Another idea ?


Posted By: mdoubson
Date Posted: 23 February 2009 at 12:02pm

Could you give us error code you get in this case please.

Could you browse to same url ( file://\\server\sharefolder\... - \\server\sharefolder\... )
May be this is network setup/access problem?
 
P.S. Looks like this is a question to your network admin


-------------
Mark Doubson, Ph.D.


Posted By: Fabrice
Date Posted: 23 February 2009 at 12:07pm
No error in this case, but it always open my own outlook calendar ...


Posted By: mdoubson
Date Posted: 23 February 2009 at 12:48pm
Please explain: No error in this case, but it always open my own outlook calendar
Do you access network drive or local drive?

-------------
Mark Doubson, Ph.D.


Posted By: Fabrice
Date Posted: 24 February 2009 at 4:13am
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 ?


Posted By: Fabrice
Date Posted: 27 February 2009 at 6:04am
Is there anybody ?


Posted By: mdoubson
Date Posted: 27 February 2009 at 4:37pm
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 file://\\MyServer\MyFolder\MyOutlook.pst - \\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, file://\\MyServer\MyFolder\MyOutlook.pst - \\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)


-------------
Mark Doubson, Ph.D.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net