Board index » delphi » Mail Merge Problem with Save As & Close methods

Mail Merge Problem with Save As & Close methods

Hi,

In a mail merge process during OLE automation when I use the SaveAs
method to save a Microsoft Word file. The error message I get is as
follows:

Project xxxx.exe raised exception class EOleException with message
'Command failed'

This happens when I have previously saved the file and have used the
Close method to close the file.

Any suggestions?

N.B. A quick experimental test showed that using two Save As operations
one after the
other worked fine, it only occurs having used the Close method.

Cheers Darren

 

Re:Mail Merge Problem with Save As & Close methods


If you have previously closed, then there is no document to saveas.  You
have to SaveAs and then Close.
Quote
Daz wrote in message <3630F6BC.2...@roomuw.co.uk>...
>Hi,

>In a mail merge process during OLE automation when I use the SaveAs
>method to save a Microsoft Word file. The error message I get is as
>follows:

>Project xxxx.exe raised exception class EOleException with message
>'Command failed'

>This happens when I have previously saved the file and have used the
>Close method to close the file.

>Any suggestions?

>N.B. A quick experimental test showed that using two Save As operations
>one after the
>other worked fine, it only occurs having used the Close method.

>Cheers Darren

Other Threads