Command failed and other spurious errors

A

Alfons Puig

Hi,

Using javascript we manage word documents that are in another IE frame. It
works, except sometimes that we get very ununderstandable errors. For
example:

a) Today we get a 'command failed' error on a oDocument.SaveAs(sFile,0)
statement. Why?
b) Sometimes the sequence:
oDocument.SaveAs(sFileTmp,0);
oDocument.SaveAs(sFile,0);
bFlag = oDocument.Saved;
retains sFileTmp in use (other applications can't open it) and bFlag is
false. Why?
c) Sometimes executing bFlag = oDocument.Saved; throws an exception, but the
message is blank. Why?

Thanks,

Alfons
(e-mail address removed)
 
C

Cindy M -WordMVP-

Hi Alfons,

In case you hadn't noticed, you've posted this in an end-user newsgroup. Little
chance of getting an automation question answered in here! If I had a concrete
idea, I'd tell you, but I have no experience with javascript or IE. Command
failed basically means that Word is unable to perform the actin in its current
state. At the moment, I can't imagine what could cause SaveAs to fail, unless
you're passing an invalid path or file name.

If that's not the case, then I recommend you take a look at the list of
office.developer newsgroups, read some of the messages, then post to the group
that seems most appropriate.
Using javascript we manage word documents that are in another IE frame. It
works, except sometimes that we get very ununderstandable errors. For
example:

a) Today we get a 'command failed' error on a oDocument.SaveAs(sFile,0)
statement. Why?
b) Sometimes the sequence:
oDocument.SaveAs(sFileTmp,0);
oDocument.SaveAs(sFile,0);
bFlag = oDocument.Saved;
retains sFileTmp in use (other applications can't open it) and bFlag is
false. Why?
c) Sometimes executing bFlag = oDocument.Saved; throws an exception, but the
message is blank. Why?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
A

Alfons Puig

Hi Cindy,

When the error is produced I display all the variables, and the Path and
filename are both correct. I have also posted the same message to other
newsgroups (oleinterop and application.errors) without success (for the
moment).

"Cindy M -WordMVP-" escribió:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top