Problem Using Ole Automation within a tthread !

"O.H" <> skrev i melding

> I'm trying to use ole automation within a TThread using a code like

> var
>  ooword:variant;
> begin
> ooword:-createoleobject('word.application');
> ooword.visible:=true;
> end;

> but all I get is a ole automation error.

> This code works perfectly fine when it's not within a tthread !

> Is there any reason why ole automation should not work within threads ?

May be you'll have to call

  CoInitializeEx (MultiThreaded);

...but if you want to read more about this, see this article:

Bjoerge Saether
Consultant / Developer
Asker, Norway (remove the obvious)