views:

965

answers:

9

Our ASP.NET/C# lets users edit and manage Word (OpenXML) documents that are hosted on a server. I am using client-side VBScript functions to handle some of the editing functions including saving the document to a folder on the server. For the save functionality, I am using the following function call :

Document.SaveAs "http://server/savefolder/savefile.docx"

I have given "Full Control" permissions on savefolder to both the NETWORK SERVICE and the IUSR_MACHINE users. Yet the above call fails. The error number returned is 5096. The error message is some gibberish that doesn't make any sense.

The server is Windows 2003 and the IIS version is 6.0. I have installed the OpenXML SDK 2.0 CTP on the server.

I can successfully read and print documents.

Does anyone tell me what I am doing wrong? or what additional settings need to be in place?

A: 

Just a guess... if the vbscript is running on the client, the code is probably running under the user's account, not under the server's IIS account. So unless you give write access to that user, vbscript probably won't work for this.

Since you're using ASP.NET, you could try writing a web service that takes in Word document data and saves it to the server for you.

davogones
A: 

Thanks for your answers!

Michael - Giving permissions to the ASPNET account didn't seem to help. None of the suggestions on the Manifold thread helped either. Thanks for the link though.

davogones - Isn't that the purpose of the IUSR_MACHINE account, provide a proxy for users coming in through the web?

A: 

BTW, the error message ("gibberish" from my post) is:

"EOALPHABETICARABICARABICABJADARABICALPHABAHTTEXTCAPSCARDTEXTCHARFORMATCHI"

No, I am not making this up!

A: 

Is the save folder you're using outside of the websites root directory, i.e. 'hidden' from the internet?

A: 

Jamie - It is actually a subfolder under Inetpub\wwwroot

A: 

I'd try running Fiddler on the client while trying to save the document to get a sense of what's really going on. I wonder if maybe it's trying to do an HTTP PUT (as opposed to a POST).

Craig
A: 

Have you given write access to the folder in IIS manager?

ctrlalt3nd
+1  A: 

Turns out WebDAV is not turned on by default in IIS 6.0. Once I turned it on, I was able to save the documents just fine.

Thanks for all your answers!

+1  A: 

In my case, that error 5096 with description "EOALPHABETICARABICARABICABJADARABICALPHABAHTTEXTCAPSCARDTEXTCHARFORMATCHI" occurred when using VBA code in Access to drive a Word mail-merge. The cause was trying to save a document with the same name (including path) as an open document.

Error line:

objApp.ActiveDocument.SaveAs saveAsName

where objApp is the object variable representing the Word application and saveAsName is the string variable storing the name I am trying to save the file as e.g. "C:\temp\testdoc.docx".

IF a file with the same name exists but is not open, the above code overwrites it silently.

Si
If you have a follow up question you should post it asa new question, not as an answer to this old question.More people will read it since old questions are not frequented very much.The "Ask Question" button is in the top right.
sth
Thanks sth. I don't have a follow-up question, I just added my comment in the spirit of information sharing. There were very few links when I googled the error number and description, so I added my knowledge to this old question. I don't need lots of people to see it, just people who are searching for this particular error number and description.
Si
Oh, right, you actually explain where that error comes from... Sorry, I obviously didn't read your posts thoroughly back then. Actually your answer probably shows the reason for the problem in the original question, unlike all the other "answers" in this thread.
sth