Use the ActiveXObject control in javascript to replace word bookmarks and export the content to the word before printing _ javascript skills

Source: Internet
Author: User
Because of the tight schedule, I have to study the above toolkit in a few cases. Now I use javascript to operate the ActiveXObject control and replace the bookmarks in the word template. Because of the tight schedule, I have to study the above toolkit in a few cases. Now I use javascript to operate the ActiveXObject control and replace the bookmarks in the word template.

Recently, you need to export data to word and edit and print the data.
I have thought of several solutions:
1. Use jacob.
2. Use apache poi.
3. Use itext.
Because of the tight schedule, I have to study the above toolkit in a few cases. Now I use javascript to operate the ActiveXObject control and replace the bookmarks in the word template.

Prerequisites:
1. the browser security level is reduced. You can use the ActiveXObject control.

2. Install office word.

Currently, you can replace a single bookmarks, multi-row table bookmarks, and images to meet your needs. However, there are still many ways to use word that are unclear. Most of the Web applications use VB. If you have any questions, you can contact us.

The following describes my design implementation ideas:

First of all, define the word template and add the tag to the place to be replaced. Menu-insert-bookmarks, INPUT attribute names, such as year, date, pic1, and voList.
Print page:
The printed data needs to be taken out from the background, and taken a single vo (an object) as a group, or voList (a list set of objects) after the data is obtained for a group of organized pages, replace the data.
The data is organized as follows:









Usage:


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.