Problem with saving a word document

K

koala

Hi,
I'm trying to save a document from a web click as described in the
knowledge base article.

http://support.microsoft.com/kb/316384/EN_US

Instead of using Windows Application I use web application asp button to do
the work. I'm trying to save the document. However, both save and saveAs
doesn't not work for some reason. Here is the code for save:

object fileName = "c:\\MyNewDocument.doc";
oWord.Documents.get_Item(ref fileName).Save();

It gives me this error:System.Runtime.InteropServices.COMException: Bad file
name

When I try to use saveAs as follow:

oDoc.SaveAs(ref fileName, ref missingValue,ref missingValue, ref
missingValue, ref missingValue,ref missingValue, ref missingValue, ref
missingValue,
ref missingValue, ref missingValue, ref missingValue,ref missingValue, ref
missingValue, ref missingValue,ref missingValue, ref missingValue);

It hangs forever and does not go through.
I'm thinking that I should use SaveAs as the same behaviour of word, is that
true? If we don't save the document, would it appear in anywhere in the
default path?
Thanks for the help in advance

Koala
 

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