selecting default data provider |
Post Reply |
Author | |
timcpa
Newbie Joined: 27 August 2006 Location: United States Status: Offline Points: 8 |
Post Options
Thanks(0)
Posted: 27 August 2006 at 1:19pm |
Where in the code can the default data provider be set upon running the sample? I want to default to MAPI outlook, so this is the data source when running the sample.
Whenever MAPI is selected in the sample, it causes an error when the program stops running in VB and even after the program is compiled upon exiting the sample and error is displayed. Is there a fix that is causing this system error> |
|
tim
|
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
To open MAPI data provider it is enough on form loading setup it in a following way:
CalendarControl.SetDataProvider "Provider=MAPI;" And open it: CalendarControl.DataProvider.Open There should not be any errors when using it. It would be better if you submit your crash report into support area http://www.codejock.com/support/ with as much details as possible. -- Regards, Serge |
|
timcpa
Newbie Joined: 27 August 2006 Location: United States Status: Offline Points: 8 |
Post Options
Thanks(0)
|
That works fine, but would like to not be prompted for the "Choose Profile". Tried setting the default option in the dialog, but this does nothing in regards to setting as the default profile.
Thanks in advance. |
|
tim
|
|
timcpa
Newbie Joined: 27 August 2006 Location: United States Status: Offline Points: 8 |
Post Options
Thanks(0)
|
any answer for the last post?
|
|
tim
|
|
timcpa
Newbie Joined: 27 August 2006 Location: United States Status: Offline Points: 8 |
Post Options
Thanks(0)
|
That works fine, but would like to not be prompted for the "Choose Profile". Tried setting the default option in the dialog, but this does nothing in regards to setting as the default profile. Thanks in advance. |
|
tim
|
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
There was no answer because for now this is not possible...
This "Choose Profile" dialog is shown by MAPI itself, and this "set default" button never worked there. Dialog will not be shown if only a MAPI session is already open, for example when Outlook is opened. For future will add a possibility to specify a name of the profile for this dialog, something like "Provider=MAPI;ProfileName=Somename;" -- WBR, Serge |
|
nariofox
Newbie Joined: 09 October 2006 Status: Offline Points: 1 |
Post Options
Thanks(0)
|
First Add a Reference to Microsoft CDO 1.21 (Collobaration Data Object)
Use the following code private sub Form_Load() Dim objSession As MAPI.Session Dim MAPISession As Outlook.NameSpace Set objSession = CreateObject("MAPI.Session") Set MAPISession = Application.Session If Not MAPISession Is Nothing Then MAPISession.Logon , , True, False End If OpenProvider cjCalendarData_MAPI, "Provider=MAPI" end sub Public Sub OpenProvider(ByVal eDataProviderType As CodeJockCalendarDataType, ByVal strConnectionString As String) CalendarControl.SetDataProvider strConnectionString If Not CalendarControl.DataProvider.Open Then CalendarControl.DataProvider.Create End If CalendarControl.Populate Exit Sub End Sub |
|
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 |