Simple operation of Word documents in ASP. NET

Source: Internet
Author: User

We recommend two links:
Http://www.codeproject.com/aspnet/wordapplication.asp
Http://www.c-sharpcorner.com/UploadFile/mgold/WordFromDotNet11082005235506PM/WordFromDotNet.aspx
In fact, we can find more in-depth information on the Internet. If we just draw data from dataset to a simple application like word, then the two articlesArticleIt may be suitable. In addition, Let's record two of my experiences:
1. Define wordapp and worddoc

// It's a reference to the COM Object of Microsoft Word application
Private Word. applicationclass owordapplic;
// It's a reference to the document in use
Private Word. Document oworddoc;

codeproject is defined as follows. Other methods are also available in other documents, such as:
word. application owordapp; (this method seems to conflict with quit, and will prompt during compilation) or word. _ application owordapp;
likewise, the document definition is the same:
word. _ document oworddoc; or word. documentclass oworddoc;
of course, if you use word. documentclass, using wordapp. documents. the add () method forcibly converts the return value to word. documentclass.
it's confusing to have a look at it. In fact, the methods are the same. You can see how they are define;
Public interface _ document
{...}
Public interface document: _ document, incluentevents_event
{...}
public class documentclass: _ document, document, documentevents_event
{...}

Public interface _ application
{...}
Public interface application: _ application, applicationevents2_event
{...}
public class applicationclass: _ application, application, applicationevents2_event, applicationevents_event
{...}
2. About word. table
in word, if you press enter directly at the end of the table, a new row is added to the table while the line breaks. Similarly, this problem occurs when we use the Program to operate the word. If another table is inserted immediately after the table, then the two tables are merged into one. If you want to separate tables, you can insert a space to separate them.
another question is, how can I insert the table title on each table? Kindly advise.

Related 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.