Delphi 5 and Standard Office Servers

Hi,
   I'm using Delphi 5 enterprise and office 2000 premium.  I want to add a task item to outlook.  When I drop the TTaskItem component (servers tab) on my form and run it.  I get class not registered.  I understand what this means but how do I register the TTaskItem class.  

p.s.
I've tried reinstalling office.

Cheers
Woody
WoodyJ3Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

LischkeCommented:
I tried it myself, but got only the Outlook server to auto attach not the task item. So I'm lurking here and listening...

Ciao, Mike
0
topkapiCommented:
are the office automation components build for office2000 or an earlier version? are they compatible with office2000?

(listening)

topkapi
0
WoodyJ3Author Commented:
Not sure.  But even if I use the office 2000 type library, and try and create the task item object I still get class not registered.  I'm starting to think this is not a Delphi problem but a Microsoft registration issue.
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

topkapiCommented:
does

CreateOleObject('Word.Application or wather it is called') work?

0
LischkeCommented:
I did a search through Dejanews and found that obviously all know that you cannot use the server components with Office 2000. The only way the got it working was to import the type library again. More precisely you need to import the olb file rather than tlb.

Ciao, Mike
0
florisbCommented:
copy-pasted some code from old test project (Ole way instead of COM), you don't need the Delphi components for this; just import the Outlook type library (Project | Import type library | create unit)

Works with Outlook 2000, should also work with older versions.




var
/// De variabelen voor de classes.
 FOutlook: OleVariant;
 OutlookTask : TOutlookTask;

//create Outlook with: FOutlook := CreateOleObject('Outlook.Application');


procedure TOutlookTask.OleTask(subject,date: string; HIGHimportance: boolean );
{***********************************************************
pre: outlook is running
discription: create new task with subject, date and importance; save it in folder.
inputs: subject, date, HihjImportance (booelean)
returns: none
***********************************************************}
var
objNS,objDoc : Olevariant;
begin
FOutlook := GetActiveOleObject('Outlook.Application');
objNS:= FOutlook.GetNamespace('MAPI');
objDoc:= FOutlook.CreateItem(olTaskItem);
objDoc.Subject:= subject;
if HIGHImportance then
   objDoc.Importance := olImportanceHigh
else
   objDoc.Importance := olImportanceLow;
objDoc.DueDate := date;
//// et cetera
//// ......
objDoc.Save;
end;


procedure TOutlookTask.OleNew;
{***********************************************************
pre: outlook is running
discription: open new task
inputs: none
returns: none
***********************************************************}
var
objNS, objDoc : Olevariant;
begin
FOutlook := GetActiveOleObject('Outlook.Application');
objNS:= FOutlook.GetNamespace('MAPI');
objDoc:= FOutlook.CreateItem(olTaskItem);
objDoc.Display;
end;


Good luck,
Floris.

ps. can anybody help me with the fight against the databasegrid? See posted question.
0
florisbCommented:
errr, you can prob. ship the lines objNS := ....   ;-(
0
mscatenaCommented:
You must have a TOutlookApplication and create the item trough it, calling CreateItem. Look at the code to create an email item:

    OutlookApplication1.Connect;
    // This line creates  a item and binds it to a “Server component”. You must cast it too
    MailItem1.ConnectTo(OutlookApplication1.CreateItem(olMailItem) as _DMailItem);
    MailItem1.Recipients.Add(Edit1.Text);
    MailItem1.Subject := Edit2.Text;
    MailItem1.Body := Memo1.Text;
    MailItem1.Send;
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
WoodyJ3Author Commented:
Only just read all the above.   Im gonna try it out now.  Stand by.

Cheers
Woody
0
WoodyJ3Author Commented:
Spot on mate.  It was the task item I actually wanted so I just changed Mail to Task and hey-presto!!

Cheers
Woody.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.