![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
Hey all, I've search all the forum, tried many solution, but none of them
works for me ![]() Here's my problem. I'm developping an application in VB6 that must send appointment using Outlook ( we're using MicrosoftExchange ). The problem is that i have two profiles bind to my outlook. 1-My regular profiles for my mail ( default ) called : MainProfile 2-The one that need to send all appointments called : AppointmentProfile Whenever i try to send an appointment, it always use Mainprofile to send it, even if i specified AppointmentProfile in the logon. Note that the 'When starting Outlook use this profile' option in Outlook is pointing at MainProfile in case it matters. Thanks all for you help!!! [CODE START HERE] Dim olApp As outlook.Application Dim olNs As outlook.NameSpace Dim olCal As outlook.mapiFolder Dim mapiSession As mapi.Session Set olApp = CreateObject("Outlook.Application") Set olNs = olApp.GetNamespace("MAPI") Set olCal = olNs.GetDefaultFolder(olFolderCalendar) Set mapiSession = New mapi.Session mapiSession.Logon "AppointmentProfile", "", False Dim olAppt As outlook.AppointmentItem Set olAppt = olApp.CreateItem(olAppointmentItem) (... fill the appointment ... ) olAppt.Send olAppt.Save mapiSession.Logoff Set mapiSession = Nothing [ END OF CODE] |
#2
|
|||
|
|||
![]()
Under the Outlook object model, only one mail profile can be running at a time. If Outlook is already running, you can't perform a logon to another profile. For your scenario, you would need to use CDO 1.21 or, to avoid security prompts, Redemption (http://www.dimastr.com/redemption/) instead of Outlook objects.
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "David" wrote in message ... Hey all, I've search all the forum, tried many solution, but none of them works for me ![]() Here's my problem. I'm developping an application in VB6 that must send appointment using Outlook ( we're using MicrosoftExchange ). The problem is that i have two profiles bind to my outlook. 1-My regular profiles for my mail ( default ) called : MainProfile 2-The one that need to send all appointments called : AppointmentProfile Whenever i try to send an appointment, it always use Mainprofile to send it, even if i specified AppointmentProfile in the logon. Note that the 'When starting Outlook use this profile' option in Outlook is pointing at MainProfile in case it matters. Thanks all for you help!!! [CODE START HERE] Dim olApp As outlook.Application Dim olNs As outlook.NameSpace Dim olCal As outlook.mapiFolder Dim mapiSession As mapi.Session Set olApp = CreateObject("Outlook.Application") Set olNs = olApp.GetNamespace("MAPI") Set olCal = olNs.GetDefaultFolder(olFolderCalendar) Set mapiSession = New mapi.Session mapiSession.Logon "AppointmentProfile", "", False Dim olAppt As outlook.AppointmentItem Set olAppt = olApp.CreateItem(olAppointmentItem) (... fill the appointment ... ) olAppt.Send olAppt.Save mapiSession.Logoff Set mapiSession = Nothing [ END OF CODE] |
#3
|
|||
|
|||
![]()
Hi sue, thanks for the help.
What's the difference with Outlook object and CDO1.21 object? Do you have any example of CDO1.21 session logon ? I'll try to find some article on CDO1.21, i'll be back later Thanks again!! "Sue Mosher [MVP-Outlook]" wrote: Under the Outlook object model, only one mail profile can be running at a time. If Outlook is already running, you can't perform a logon to another profile. For your scenario, you would need to use CDO 1.21 or, to avoid security prompts, Redemption (http://www.dimastr.com/redemption/) instead of Outlook objects. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "David" wrote in message ... Hey all, I've search all the forum, tried many solution, but none of them works for me ![]() Here's my problem. I'm developping an application in VB6 that must send appointment using Outlook ( we're using MicrosoftExchange ). The problem is that i have two profiles bind to my outlook. 1-My regular profiles for my mail ( default ) called : MainProfile 2-The one that need to send all appointments called : AppointmentProfile Whenever i try to send an appointment, it always use Mainprofile to send it, even if i specified AppointmentProfile in the logon. Note that the 'When starting Outlook use this profile' option in Outlook is pointing at MainProfile in case it matters. Thanks all for you help!!! [CODE START HERE] Dim olApp As outlook.Application Dim olNs As outlook.NameSpace Dim olCal As outlook.mapiFolder Dim mapiSession As mapi.Session Set olApp = CreateObject("Outlook.Application") Set olNs = olApp.GetNamespace("MAPI") Set olCal = olNs.GetDefaultFolder(olFolderCalendar) Set mapiSession = New mapi.Session mapiSession.Logon "AppointmentProfile", "", False Dim olAppt As outlook.AppointmentItem Set olAppt = olApp.CreateItem(olAppointmentItem) (... fill the appointment ... ) olAppt.Send olAppt.Save mapiSession.Logoff Set mapiSession = Nothing [ END OF CODE] |
#4
|
|||
|
|||
![]()
CDO is a lower-level API. You can get lots of information on it and the Session.Logon method at http://www.cdolive.com
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "David" wrote in message ... Hi sue, thanks for the help. What's the difference with Outlook object and CDO1.21 object? Do you have any example of CDO1.21 session logon ? I'll try to find some article on CDO1.21, i'll be back later Thanks again!! "Sue Mosher [MVP-Outlook]" wrote: Under the Outlook object model, only one mail profile can be running at a time. If Outlook is already running, you can't perform a logon to another profile. For your scenario, you would need to use CDO 1.21 or, to avoid security prompts, Redemption (http://www.dimastr.com/redemption/) instead of Outlook objects. "David" wrote in message ... Hey all, I've search all the forum, tried many solution, but none of them works for me ![]() Here's my problem. I'm developping an application in VB6 that must send appointment using Outlook ( we're using MicrosoftExchange ). The problem is that i have two profiles bind to my outlook. 1-My regular profiles for my mail ( default ) called : MainProfile 2-The one that need to send all appointments called : AppointmentProfile Whenever i try to send an appointment, it always use Mainprofile to send it, even if i specified AppointmentProfile in the logon. Note that the 'When starting Outlook use this profile' option in Outlook is pointing at MainProfile in case it matters. Thanks all for you help!!! [CODE START HERE] Dim olApp As outlook.Application Dim olNs As outlook.NameSpace Dim olCal As outlook.mapiFolder Dim mapiSession As mapi.Session Set olApp = CreateObject("Outlook.Application") Set olNs = olApp.GetNamespace("MAPI") Set olCal = olNs.GetDefaultFolder(olFolderCalendar) Set mapiSession = New mapi.Session mapiSession.Logon "AppointmentProfile", "", False Dim olAppt As outlook.AppointmentItem Set olAppt = olApp.CreateItem(olAppointmentItem) (... fill the appointment ... ) olAppt.Send olAppt.Save mapiSession.Logoff Set mapiSession = Nothing [ END OF CODE] |
#5
|
|||
|
|||
![]()
Thanks a lot Sue.
It works perfectly. Using CDO, I'm able to send/delete any appointment in Outlook using my 2nd profile. You're the best ![]() Best regards David "Sue Mosher [MVP-Outlook]" wrote: CDO is a lower-level API. You can get lots of information on it and the Session.Logon method at http://www.cdolive.com -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "David" wrote in message ... Hi sue, thanks for the help. What's the difference with Outlook object and CDO1.21 object? Do you have any example of CDO1.21 session logon ? I'll try to find some article on CDO1.21, i'll be back later Thanks again!! "Sue Mosher [MVP-Outlook]" wrote: Under the Outlook object model, only one mail profile can be running at a time. If Outlook is already running, you can't perform a logon to another profile. For your scenario, you would need to use CDO 1.21 or, to avoid security prompts, Redemption (http://www.dimastr.com/redemption/) instead of Outlook objects. "David" wrote in message ... Hey all, I've search all the forum, tried many solution, but none of them works for me ![]() Here's my problem. I'm developping an application in VB6 that must send appointment using Outlook ( we're using MicrosoftExchange ). The problem is that i have two profiles bind to my outlook. 1-My regular profiles for my mail ( default ) called : MainProfile 2-The one that need to send all appointments called : AppointmentProfile Whenever i try to send an appointment, it always use Mainprofile to send it, even if i specified AppointmentProfile in the logon. Note that the 'When starting Outlook use this profile' option in Outlook is pointing at MainProfile in case it matters. Thanks all for you help!!! [CODE START HERE] Dim olApp As outlook.Application Dim olNs As outlook.NameSpace Dim olCal As outlook.mapiFolder Dim mapiSession As mapi.Session Set olApp = CreateObject("Outlook.Application") Set olNs = olApp.GetNamespace("MAPI") Set olCal = olNs.GetDefaultFolder(olFolderCalendar) Set mapiSession = New mapi.Session mapiSession.Logon "AppointmentProfile", "", False Dim olAppt As outlook.AppointmentItem Set olAppt = olApp.CreateItem(olAppointmentItem) (... fill the appointment ... ) olAppt.Send olAppt.Save mapiSession.Logoff Set mapiSession = Nothing [ END OF CODE] |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to make old .pst calendar the default in a new profile? | Pinky01 | Outlook - Calandaring | 6 | March 13th 08 09:23 PM |
Get default outlook profile EMailID | Sanjay_S via OfficeKB.com | Outlook and VBA | 1 | October 16th 06 08:51 PM |
default outlook profile | John M | Outlook - General Queries | 3 | August 11th 06 04:56 PM |
Creating a new MST for Office 2K3 and need help with the default profile variable | [email protected] | Outlook - Installation | 0 | May 5th 06 06:12 PM |
Default Outlook Profile | NoSurprises | Outlook - Installation | 0 | January 20th 06 06:04 PM |