Online Editing of office documents

Source: Internet
Author: User

Versions later than Office XP support direct editing of files on the server through WebDAV protocol (HTTP extension.
IIS (6.0) supports WebDAV, which can be seen in the Web service extension of IIS manager. using IIS as the WebDAV server, you can easily edit office (Word, Excel, etc.) online.
You can perform a simple experiment:
Ensure that iis's webdavy is installed and enabled, create a virtual directory test, put a wordfile a.doc in it, then open the word, file-> open-> enter the access URL of the Word file (http: // localhost/test/a.doc ),
Modify the document content and save it. What happened? The document is saved to the server.
In IE, you can use js to create Word. Application to open and modify documents on the server. CopyCode The Code is as follows: wapp = new activexobject ("word. application.11 ");
Wapp. Visible = true;
Wapp. Documents. Open (URL );
If (trackrevisions) {// can trace retention be achieved?
Wapp. activedocument. trackrevisions = true;
Wapp. activedocument. showrevisions = false;
} Else
{
Wapp. activedocument. trackrevisions = false;
Wapp. activedocument. showrevisions = false;
}
Wapp. activedocument. application. Username = global_currentusername;

In addition, an ActiveX component: Sharepoint. opendocuments is installed at the same time. Can this component be used to activate word and edit the document on the server: VaR _ opendocuments = NULL; Copy code The Code is as follows: function document_edit2 (URL)
{
If (_ opendocuments = NULL)
{
Try {
_ Opendocuments = new activexobject ("Sharepoint. opendocuments.3"); // For Office 2007
} Catch (e ){}
If (_ opendocuments = NULL | typeof (_ opendocuments) = "# ff0000 ")
{
Try {
_ Opendocuments = new activexobject ("Sharepoint. opendocuments.2"); // For Office 2003
} Catch (e ){}
}
If (_ opendocuments = NULL | typeof (_ opendocuments) = "undefined ")
{
Alert ("Please install word (2003 or later )");
Return;
}
}
// Opendocobj. viewdocument ("http://www.abc.com/documents/sample.doc");, "word. Document"
// Opendocobj. createnewdocument ("http://www.abc.com/documents/sampleTemplate.dot", "http://www.abc.com/documents ");
VaR result = _ opendocuments. editdocument (URL, "word. Document ");
If (result = false)
{
Alert ("unable to open document .");
}
}

We can see that IIS-based WebDAV supports online editing of office documents, but there is a problem: in this way, documents are stored in the file system, in many of our systems,
The document is stored in the database. How can this problem be achieved ???
I tried a lot and found the solution. It will be in the next article.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.