4
Answers

This command is not available because no document is open.

Vijay Maurya

Vijay Maurya

9y
1.8k
1
Some body help me 
I got error when we use below code [i m doing .docx to ,htm file coversion meas save file .docx to .htm]
 
 Code is-
Microsoft.Office.Interop.Word.Application app;
app.Documents.Open(ref FileName, ref readOnly, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref isVisible, ref missing, ref missing, ref missing,
ref missing, ref missing);
Document oDoc = app.ActiveDocument;
oDoc.SaveAs(ref FileToSave, ref fltDocFormat, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing);
 
Error is- 

This command is not available because no document is open.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: This command is not available because no document is open.

Source Error:

 Document oDoc = app.ActiveDocument;           
 
Answers (4)
3
Nitin Sontakke

Nitin Sontakke

NA 11.7k 2.2k 8y
Web technologies are evolving day-by-day and i am not quite up-to-date with the evolution.
 
However, I am pretty certain that you would need some sort of server-side processing. From the way you have framed the question, it seems to me, that you are not quite clear about the request-response model of http protocol on which the web works.
 
Connecting to sql server from javaScript, while might be possible (I am not sure), it is not a very good idea from security perspective, i guess.
 
And where would you put all your business logic?
 
Calling asp.net a front-end would be incorrect. It is a server side technology.
 
You can have all your front-end in HTML5, CSS and Javascript and write a server-side code in WebAPI.
 
You may wish to look into serverless architecture (I still not have looked into!)