Solved

Use Outlook COM objects from shared profile/Install MAPI

Posted on 2002-06-06
9
494 Views
Last Modified: 2010-04-04
System: Windows 2000, Exchange 2000, Outlook XP (2002)

I have made a program that accesses an Outlook public appointments folder by creating an Outlook.Application OLE object.  It allows the user only to add appointments at certain times and 1 hour blocks.  It works just fine under my profile.

My problem now is that there is a group of about 50 users that have a shared mandatory Windows profile and do not have an Outlook profile (using a group policy, Outlook.exe is blocked).  I somehow need to be able to access the public folder anyway.

Possible solution #1:
Create a "dummy" Exchange 2000 account (by creating a new user in Active Directory) that everyone uses.  Set it up for the shared profile.

Problem:
olFolder := olNameSpace.Folders('Public Folders').Folders('All Public Folders').Folders('Appts');
gives a "You do not have permission to log on" error, even though I gave the "dummy" user "Owner" permissions.


Possible solution #2:
Use MAPI.Session instead of Outlook.Application.  This will provide the ProfileInfo parameter in the olNameSpace.Logon method (look at http://support.microsoft.com/default.aspx?scid=kb;EN-US;q195662).

Problem:
During runtime, olApp := CreateOleObject('MAPI.Session'); gives the error "Invalid class string".  I have installed Outlook 2002 and set up an Exchange account, which should have installed MAPI, but apparently it hasn't.  I've searched all over the web and can't find any other way to install it (or make sure it is).

Possible solution #3:
Do you have any? :)

So in summary, I need to somehow install MAPI so "MAPI.Session" will work, or fix "You do not have permission to log on".

Any help is appreciated.  I am out of ideas right now.
0
Comment
Question by:NelsonR
9 Comments
 
LVL 4

Expert Comment

by:StevenB
ID: 7061064
 To use The MAPI.Session Object I'm pretty sure you need to have CDO installed. The default install of Outlook does not install CDO if I recall correctly, you have to select it specifically. http://www.cdolive.com/ is a great site for CDO and MAPI info.

  Hope this helps somewhat.

  Steven
0
 

Author Comment

by:NelsonR
ID: 7062126
Where do you select it specifically?  I couldn't find it anywhere.  Also, cdolive is outdated :(
0
 
LVL 4

Expert Comment

by:StevenB
ID: 7063904
 On your Office 2000 CD select "Add or Remove Features". When presented with the options dropdowns make sure that "Microsoft Office -> Microsoft Outlook for Windows -> Collaboration Data Objects" is selected, by default it is not. This should give you access to CDO programming functionality.

  The http://www.cdolive.com/ site is undergoing upgrades, but the old content is avbailable at http://www.cdolive.com/start.htm in particular the CDO help file available at http://www.cdolive.net/download/cdo.zip is a great resource.

  Regards,

  Steven.
 
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:NelsonR
ID: 7066946
I figured out how to install CDO and finally was able to log on, etc.  Now that I ran the program from the shared user's account I got a "You do not have permission to log on. [Microsoft Exchange Server Information Store - [MAPI_E_FAILONEPROVIDER(8004011D)]]." error.. :(

Here's my code:
------------------
 cdoSession := CoSession.Create;
 cdoSession.Logon('', '', false, true, 0, true, 'Mail' + #10 + 'OutlookAccess');
 cdoPublicStore := cdoOpenFolder(cdoSession.InfoStores.Item[1].RootFolder.Folders, 'All Public Folders');
 cdoACNAppt := cdoOpenFolder(cdoOpenFolder(cdoPublicStore.Folders, 'ACN').Folders, 'Appointments').Messages;

 cdoMessage := cdoACNAppt.GetFirst;
 ShowMessage(cdoMessage.Subject);

--------------

function TfACNAppts.cdoOpenFolder(Folders: OleVariant; FolderToOpen: String): OleVariant;
var i: Integer;
begin
 for i := 1 to Folders.Count do
  if Folders.Item[i].Name = FolderToOpen then
  begin
   Result := Folders.Item[i];
   break;
  end;
end;
--------------

Note the Logon() function that has:
'Mail' + #10 + 'OutlookAccess'

I am connecting to the server named 'Mail' to the account 'OutlookAccess', so it shouldn't be using the local profile.  Why does it work for me (domain admin) and not them (domain users only)?
0
 

Author Comment

by:NelsonR
ID: 7067021
I might have solved it. I just gave "Everyone" full rights to the "OutlookAccess" mailbox.. It now logs in.. I am getting another error later on which I wasn't getting before, but I should be fine.
0
 

Author Comment

by:NelsonR
ID: 7067166
Hmm.. OK, so it logs in, but now it can't find the "ACN" folder (Appointments is a subfolder) even though 'OutlookAccess' has Owner rights to it
0
 

Author Comment

by:NelsonR
ID: 7070956
So no one knows/has done this?  I've tried Outlook COM objects, MAPI, CDO 1.21, CDOEX, etc. can't figure it out.
0
 
LVL 1

Expert Comment

by:pnh73
ID: 9010474
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

PAQ and Refund

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer
0
 
LVL 6

Accepted Solution

by:
Mindphaser earned 0 total points
ID: 9101878
Force accepted

** Mindphaser - Community Support Moderator **
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
calling Tcolordialog in dll make the form disappear 8 111
code issue 8 129
Using idhttp to login to instagram 2 89
Show Listview image from database (String field) 5 124
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question