🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: alt.comp.lang.borland-delphi
2 messages
2 total messages Started by Michael Posthuma Sun, 13 Apr 2003 06:50
Funny Error with OLE
#769
Author: Michael Posthuma
Date: Sun, 13 Apr 2003 06:50
42 lines
3048 bytes
Good day

I have a very funny error, that is driving me NUTS.

I use OLEContainer to open external files.
In my Delphi Code, I use :
                    OLEContainer1.AllowActiveDoc := false;
                    OLEContainer1.AllowInPlace := false;
                    OleContainer1.CreateObjectFromFile(OLEString,false);
                    OLEContainer1.DoVerb(0);

OLEString contains a path and filename, eg "c:\abc.ppt".

Now for the funny part, on some PC's, everything works 100%.
But, on other PC's it doesn't. I get the following two errors:
"Call Rejected By Callee"
"Server execution Failed"

The "Server execution Failed" mostly happens with MS-Powerpoint.
The "Call Rejected By Callee" mostly happens with MS-WORD.

I tested these on various versions of Windows:
WIN98SE
WIN2000
WINXPHome
WINXPProf

The versions of Office is 97, 2000 or XP.
I use Delphi 5.

Then, I also went into Explorer, and double-clicked the file that gives an
error via Delphi, and it opens it 100%.
ANY Help would be greatly appreciated.
Is there a place where I can check if all the Office DLL's and/or files are
present for OLE etc.

Lastly, when I open a MS-WORD document, and close the application, it closes
the document, but keep MS-Word open. How can I make it that when I close the
Application, that the document is still open.

Thanks
Michael
Re: Funny Error with OLE
#770
Author: John Bester
Date: Mon, 14 Apr 2003 11:47
72 lines
3957 bytes
I have just tried it in Win2000 without a problem using Delphi 6. I put a
TOleContainer on a form without altering any properties and executed your
code as follows:

procedure TForm1.Button1Click(Sender: TObject);
begin
  if OpenDialog1.Execute then
  begin
    OLEContainer1.AllowActiveDoc := false;
    OLEContainer1.AllowInPlace := false;
    OleContainer1.CreateObjectFromFile(OpenDialog1.Filename,false);
    OLEContainer1.DoVerb(ovPrimary);
  end;
end;

There are two differences - I use a normal string as a filename and I use
the ovPrimary constant as a command (which is not 0).

Regards
John Bester


"Michael Posthuma" <mposthumaSPAM@acenet.co.za> wrote in message
news:3e9908b3$0$225@hades.is.co.za...
> Good day
>
> I have a very funny error, that is driving me NUTS.
>
> I use OLEContainer to open external files.
> In my Delphi Code, I use :
>                     OLEContainer1.AllowActiveDoc := false;
>                     OLEContainer1.AllowInPlace := false;
>                     OleContainer1.CreateObjectFromFile(OLEString,false);
>                     OLEContainer1.DoVerb(0);
>
> OLEString contains a path and filename, eg "c:\abc.ppt".
>
> Now for the funny part, on some PC's, everything works 100%.
> But, on other PC's it doesn't. I get the following two errors:
> "Call Rejected By Callee"
> "Server execution Failed"
>
> The "Server execution Failed" mostly happens with MS-Powerpoint.
> The "Call Rejected By Callee" mostly happens with MS-WORD.
>
> I tested these on various versions of Windows:
> WIN98SE
> WIN2000
> WINXPHome
> WINXPProf
>
> The versions of Office is 97, 2000 or XP.
> I use Delphi 5.
>
> Then, I also went into Explorer, and double-clicked the file that gives an
> error via Delphi, and it opens it 100%.
> ANY Help would be greatly appreciated.
> Is there a place where I can check if all the Office DLL's and/or files
are
> present for OLE etc.
>
> Lastly, when I open a MS-WORD document, and close the application, it
closes
> the document, but keep MS-Word open. How can I make it that when I close
the
> Application, that the document is still open.
>
> Thanks
> Michael
>
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads