Board index » delphi » Winword, please help

Winword, please help

I am fighting winword, trying to control it from delphi 2.0 via ole.
This is somewhat urgent, so I am grateful for all help.

I used to run vs.word 7.0 and I had some code that worked. On my dev.PC,
that is. However it wouldn't work anywhere else. Why would other PC's
say that command not supported by ole object when they worked on mine?

Well, over to the present: I will now try to upgrade to use word97
instead. However I can't get anything to work like it did.
1) Word doesn't start using WinExec (I haven't figured out how to use
   CreateProcess, but it also seems it is not importantto start word
   in advance with v97 as ole starts it itself, like 7.0 didn't). Why?
   All I get is the square with logo in, and then it shuts down again.

2) Word seems to start when I just give Ole commands, but it is invisible.
   At least it performed a FileSaveAs under new name. However now I
   cannot shut it down (the doc can't be deleted because it's in use,
   and there's no winword to shut down!) How can I get a visible word
   to let the user do changes to a document and I can give some commands
   before the user starts working?

What I need to do is:
1) Create an empty document with the given name if it doesn't exist.
   Let the user edit this document and finish word when done (if wanted)
2) Merge a given document with a datasource. This can be invisible.
I need to be able to trust that this works on all PC's that run
winword. Allright, I understand they should have the same version of
winword since there are differences, but it did not work with the same
version with 7.0. Something unknown limits me and I don't know what.

Anyone with any hint, please reply to mor...@castor-software.no or post
here, I will be most grateful.

Morten Steinvik

--
           Disk not in drive C:  (A)bort   (R)etry   (S)uicide
        The world is but one country and the people its citizens
               http://www.colargol.tihlde.hist.no/~mortenst/

 

Re:Winword, please help


In word 97, useing 'word.basic' via OLE interface only loads a
somekind command intrepreter. If you use command 'AppShow' command
from OLE interface, then you will have word visible.

Hope this helps

Regards Janne

On 27 Jul 1998 11:31:59 GMT, Morten Steinvik

Quote
<morte...@colargol.idb.hist.no> wrote:
>I am fighting winword, trying to control it from delphi 2.0 via ole.
>This is somewhat urgent, so I am grateful for all help.

>I used to run vs.word 7.0 and I had some code that worked. On my dev.PC,
>that is. However it wouldn't work anywhere else. Why would other PC's
>say that command not supported by ole object when they worked on mine?

>Well, over to the present: I will now try to upgrade to use word97
>instead. However I can't get anything to work like it did.
>1) Word doesn't start using WinExec (I haven't figured out how to use
>   CreateProcess, but it also seems it is not importantto start word
>   in advance with v97 as ole starts it itself, like 7.0 didn't). Why?
>   All I get is the square with logo in, and then it shuts down again.

>2) Word seems to start when I just give Ole commands, but it is invisible.
>   At least it performed a FileSaveAs under new name. However now I
>   cannot shut it down (the doc can't be deleted because it's in use,
>   and there's no winword to shut down!) How can I get a visible word
>   to let the user do changes to a document and I can give some commands
>   before the user starts working?

Other Threads