Solved

Use Outlook COM objects from shared profile/Install MAPI

Posted on 2002-06-06
9
491 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
Comment Utility
 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
Comment Utility
Where do you select it specifically?  I couldn't find it anywhere.  Also, cdolive is outdated :(
0
 
LVL 4

Expert Comment

by:StevenB
Comment Utility
 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
 

Author Comment

by:NelsonR
Comment Utility
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:NelsonR
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Force accepted

** Mindphaser - Community Support Moderator **
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

728 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now