Invention content
In view of the above problems, it is proposed that the present invention overcoming the above problem in order to provide one kind or solves at least partly
State the method and apparatus using WORD Program Generating lists of problem.
One side according to the present invention provides a kind of method using WORD Program Generating lists, including:
To one or more of WORD document list, it is inserted into respectively on the head of each list and tail portion and starts to mark
Note and end label;
One or more controls are inserted into the WORD documents, and while being inserted into each control, in same position
It is inserted into bookmark corresponding with the control and the attribute information of the control is recorded as to the data of an XML format;Wherein each book
The ID of label is identical as the ID of corresponding control;
The WORD documents are saved as into a html file;
It, will be each according to the data of beginning label and the one or more lists of end label extraction from the html file
The data of list are stored in respectively in independent html file;
To each independent html file, the bookmark in the html file is positioned, according to bookmark ID from the data of XML format
It is middle to obtain control property information corresponding with the bookmark, which is replaced with by corresponding ASP.net according to the attribute information and is controlled
The html file is saved as the list of preset format by part after the stem addition page elements of the html file.
Optionally, this method further comprises:
It monitors the opening event of WORD documents and preserves event;
When monitoring the opening event of WORD documents, the two of one or more lists are obtained from the preset table of database
System stream, and it is read as the content of the WORD documents;
It is described the WORD documents are saved as into a html file to include:When the preservation event for monitoring WORD documents
When, the binary stream of the WORD documents is output in the preset table;The WORD documents are loaded from the preset table
Binary stream a to html file in.
Optionally, this method further comprises:
The attribute information of all controls is spliced into a final XML data;The final XML data is output to
In preset table in database;
It is described control property information corresponding with the bookmark is obtained from the data of XML format according to bookmark ID to include:Root
The final XML data in the preset table is inquired according to bookmark ID, obtains control property information corresponding with the bookmark.
Optionally, this method further comprises:
When monitoring the opening event of WORD documents, URL files are read, according to the URL files presetting from database
The binary stream of one or more lists is obtained in table;
The binary stream of the WORD documents, which is output to the preset table, includes:
According to the URL interfaces of the URL files, the corresponding addresses webservice are calculated, it is corresponding by the address
The binary stream data of WORD documents are output in the preset table by webservice interfaces.
Optionally, this method further comprises:
Webbrowser plug-in units are added in the program of list to be applied;
The list of preset format is loaded using webbrowser plug-in units.
Another aspect according to the present invention provides a kind of device using WORD Program Generating lists, including:
Label is inserted into unit, for one or more of WORD document list, on the head of each list and
Tail portion is inserted into beginning label and terminates to mark respectively;
Control is inserted into unit, for being inserted into one or more controls in the WORD documents, and is being inserted into each control
While, it is inserted into bookmark corresponding with the control in same position and the attribute information of the control is recorded as an XML format
Data;The ID of wherein each bookmark is identical as the ID of corresponding control;
Data conversion storage unit, for the WORD documents to be saved as a html file;
List extraction unit, for one or more according to beginning label and end label extraction from the html file
The data of each list are stored in independent html file by the data of list respectively;
List generation unit, for each independent html file, the bookmark in the html file being positioned, according to bookmark
ID obtains control property information corresponding with the bookmark from the data of XML format, is replaced the bookmark according to the attribute information
The html file is saved as into default lattice after the stem addition page elements of the html file for corresponding ASP.net controls
The list of formula.
Optionally, which further comprises:
Monitoring unit and data capture unit;
The monitoring unit, the opening event for monitoring WORD documents and preservation event;
The data capture unit is further used for when monitoring the opening event of WORD documents, from the pre- of database
If obtaining the binary stream of one or more lists in table, and it is read as the content of the WORD documents;
The data conversion storage unit, for when monitoring the preservation event of WORD documents, by the two of the WORD documents
System stream is output in the preset table;The binary streams of the WORD documents is loaded from the preset table to a HTML text
In part.
Optionally, the data conversion storage unit is further used for the attribute information of all controls being spliced into one finally
XML data;The final XML data is output in the preset table in database;
The list generation unit, for inquiring the final XML data in the preset table according to bookmark ID, obtain with
The corresponding control property information of the bookmark.
Optionally, the data capture unit, for when monitoring the opening event of WORD documents, reading URL files,
The binary stream of one or more lists is obtained from the preset table of database according to the URL files;
The data conversion storage unit, for the URL interfaces according to the URL files, with calculating corresponding webservice
The binary stream data of WORD documents are output in the preset table by location by the corresponding webservice interfaces in the address.
Optionally, which further comprises:
List loading unit, for adding webbrowser plug-in units in the program of list to be applied;It utilizes
Webbrowser plug-in units load the list of preset format.
It can be seen from the above, technical scheme of the present invention, to one or more of WORD document list, in each table
Single head and tail portion is inserted into beginning label and terminates to mark respectively, and according to demand, suitable position is inserted in WORD documents
Enter one or more controls, and while being inserted into each control, bookmark corresponding with the control is inserted into same position and incites somebody to action
The attribute information of the control is recorded as the data of an XML format, and the design to list in WORD programs has been achieved, has connect
Get off and WORD documents saved as into a html file, from html file according to beginning label and terminate label extraction one or
The data of each list are stored in independent html file by the data of multiple lists respectively, to each independent html file,
The bookmark in the html file is positioned, control property corresponding with the bookmark is obtained from the data of XML format according to bookmark ID
The bookmark is replaced with corresponding ASP.net controls by information according to the attribute information, and the page is added in the stem of the html file
After element, which is saved as to the list of preset format.The technical solution utilizes easy-operating WORD programmings list sample
Formula, and using the bookmark function of WORD, can be extracted in wherein useful pattern after WORD documents are saved as html file
Hold and edited, ultimately generate corresponding forms pages, does not need complicated programming technique, it is easy to implement, it substantially increases
List formation efficiency.
Above description is only the general introduction of technical solution of the present invention, in order to better understand the technical means of the present invention,
And can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can
It is clearer and more comprehensible, below the special specific implementation mode for lifting the present invention.
Specific implementation mode
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in attached drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
Completely it is communicated to those skilled in the art.
Fig. 1 shows a kind of flow of method using WORD Program Generating lists according to an embodiment of the invention
Figure, as shown in Figure 1, this method includes:
Step S110 distinguishes one or more of WORD document list on the head of each list and tail portion
It is inserted into beginning label and terminates to mark.
Step S120 is inserted into one or more controls in WORD documents, and while being inserted into each control, same
Position is inserted into bookmark corresponding with the control and the attribute information of the control is recorded as to the data of an XML format, wherein often
The ID of a bookmark is identical as the ID of corresponding control.The attribute of each control can be adjusted according to user demand, such as height,
Width etc. can also correspond to the attribute information changed in corresponding XML data when preserving the modification of user.
A WORD plug-in unit can be designed to execute above-mentioned steps S110 and step S120.For example, being developed using DotNet
The plug-in unit for supporting WORD2007 and the above version, the program bag after exploitation are vsto formats, can be started simply by double-clicking
The plug-in unit is installed in WORD programs.Fig. 2-a and Fig. 2-b respectively illustrate WORD plug-in units according to an embodiment of the invention
Interface schematic diagram in WORD programs.As shown in Fig. 2-a and Fig. 2-b, which can be shown as toolbar in WORD programs
On corresponding function menu item.Fig. 2-c, which show to execute to be inserted on list head in step S110 using the plug-in unit, to be started to mark
Note, and the effect diagram after multiple controls is inserted into WORD documents.As shown, the bid inviter of grey bottom word, address, connection
It is the control that people etc. is insertion.These controls can with attribute can be adjusted according to user demand, for example, Fig. 2-d show
The interface schematic diagram using plug-in unit adjustment control property is gone out.
WORD documents are saved as a html file by step S130.WORD documents can not be directly as mis system etc.
The list directly used, therefore also need to be further processed.
Step S140 extracts the data of one or more lists from html file according to beginning label and end label,
The data of each list are stored in respectively in independent html file.
In html file at this time, there are a large amount of WORD patterns carried and the bookmarks of insertion, so html file
It is handled, extracts the data of one or list.A kind of example of extraction form data is shown below:
First with regular expression:<body>[\\s\\S]*</body>Find out the body parts in html file;
It recycles beginning label and terminates the data that label extracts each list respectively.For example, the label used for:<--
Content conditions select beginning label -->With<-- content conditions selection terminates label -->, then regular expression matching is utilized:<--
Content conditions select beginning label [ s S] *-->With<-- content conditions selection terminate label [ s S] *-->.By this
Content between the two is replaced and is taken out.
Step S150 positions the bookmark in the html file to each independent html file, according to bookmark ID from XML
Control property information corresponding with the bookmark is obtained in the data of format, is replaced with the bookmark accordingly according to the attribute information
The html file is saved as the table of preset format by ASP.net controls after the stem addition page elements of the html file
It is single.
For example, bookmark is expressed with one section of span in html file, therefore can utilize regular expression, it is fixed
Position bookmark.Such as:Utilize regular expression:<A name=" EB "+id+ "><span[\s\S]*</span></a>, take out book
ID is signed, then obtains control property information corresponding with the bookmark from the data of XML format according to bookmark ID, is found corresponding
Bookmark in HTML is substituted for corresponding ASP.net controls, as button is by control type information<asp:button id
=" "/>Input frame is<asp:Input id="/>Deng.Finally, increase necessary page elements in the stem of the page, such as:
<%@Page Language=" C# " MasterPageFile=" fixed page " AutoEventWireup=" true "
Inherits=" commonPage " ValidateRequest=" false " %>.Finally, which is saved as into aspx
The list of equal preset formats.
As it can be seen that method shown in FIG. 1, using easy-operating WORD programmings list pattern, and utilizes the bookmark of WORD
Function can extract wherein useful style content after WORD documents to be saved as to html file and be edited, most throughout one's life
At corresponding forms pages, complicated programming technique is not needed, it is easy to implement, substantially increase list formation efficiency.
In one embodiment of the invention, method shown in FIG. 1 further comprises:Monitor the opening event of WORD documents
With the event of preservation;When monitoring the opening event of WORD documents, one or more lists are obtained from the preset table of database
Binary stream, and be read as the content of WORD documents;WORD documents, which are saved as a html file, includes:When monitoring
When the preservation event of WORD documents, the binary stream of WORD documents is output in preset table;WORD texts are loaded from preset table
In the binary stream a to html file of shelves.
Similarly, the step that a WORD add-in comes in the present embodiment can be write.For example, utilizing
One engineering of VirtualStudio too developments defines list class Rb_EpointBookmark in engineering;Entire engineering
It is loaded by ThisAddIn.cs classes, specifically, the opening and preservation event of difference carry WORD documents.In the present embodiment,
In view of the relevance of list and database, therefore, the binary system of one or more lists is obtained from the preset table of database
Stream, and it is read as the content of WORD documents.Equally, it using the complete list pattern of the preset table design Storage, that is, is inserted into and adjusts
The binary stream of WORD documents after each control, and when needing to generate list, then the two of WORD documents is loaded from preset table
System flows in a html file.
In one embodiment of the invention, the above method further comprises:The attribute information of all controls is spliced into
One final XML data;Final XML data is output in the preset table in database;According to bookmark ID from XML format
Data in obtain corresponding with bookmark control property information and include:Preset table is inquired according to bookmark ID, is obtained and the bookmark
Corresponding control property information.
Specifically, the attribute information of corresponding control can be spliced into an XML data, recorded first when being inserted into bookmark
Into the tag attributes of the control, such as<Control id='XXXX'DBFiled='@fields ' sysTableName=' tables '
SysFieldName='Name'ControlType=' control types ' Prop=' control property ' Mark="/>;Finally protecting
When depositing, cycle reads the tag attributes of all controls, and the attribute information of all controls is spliced into a final XML data, example
Such as
<Controls>
<Control id='XXXX'DBFiled='@fields ' sysTableName=' tables ' sysFieldName='
Name'ControlType=' control types ' Prop=' control property ' Mark="/>
<Control id='XXXX'DBFiled='@fields ' sysTableName=' tables ' sysFieldName='
Name'ControlType=' control types ' Prop=' control property ' Mark="/>
<Control id='XXXX'DBFiled='@fields ' sysTableName=' tables ' sysFieldName='
Name'ControlType=' control types ' Prop=' control property ' Mark="/>
<Control id='XXXX'DBFiled='@fields ' sysTableName=' tables ' sysFieldName='
Name'ControlType=' control types ' Prop=' control property ' Mark="/>
</Controls>
Likewise it is possible to which final XML data is stored in the preset table in database.
Table 1 shows the table structure of the preset table of the WORD binary streams and final XML data that preserve list:
1 (table name of table:Frame_EpointForm)
Field name |
Type |
Explanation |
FormID |
Varchar(50) |
List identifies |
ReportContent |
Binary |
List WORD texts (binary stream) |
DSContent |
Binary |
Final XML data (binary stream) |
Name |
nVarchar(50) |
List name |
In one embodiment of the invention, it using preset table, can also modify to completed list.Such as
When monitoring the opening event of document, WORD binary streams and final XML data are read from preset table, are opened for WORD texts
Shelves, contain multiple controls, the attribute information of each control is already recorded in tag attributes at this time in document content.At this time may be used
The operation in such as previous embodiment is executed to modify according to demand to list, after modification, obtains new WORD binary streams
With final XML data and be stored in preset table.
In one embodiment of the invention, the above method further comprises:When the opening event for monitoring WORD documents
When, URL files are read, obtain the binary stream of one or more lists from the preset table of database according to the URL files;It will
The binary stream of WORD documents is output to preset table:According to the URL interfaces of the URL files, calculate corresponding
The binary stream data of WORD documents are output to pre- by the addresses webservice by the corresponding webservice interfaces in the address
If in table.
The concrete mode for the binary stream that one or more lists are obtained from preset table is provided in the present embodiment, i.e.,
By reading URL files, list binary stream is read from database according to the related urls in URL files, is beaten for WORD programs
It opens.After the completion of using WORD programs by form design, when pressing WORD save buttons, according to the URL interface meters of the URL files
The corresponding addresses webservice are calculated, the binary stream of WORD documents is then pushed into webservice interfaces.In addition,
Final XML data can be pushed into webservice interfaces in this way.
In one embodiment of the invention, method shown in FIG. 1 further comprises:Add in the program of list to be applied
Add webbrowser plug-in units;The list of preset format is loaded using webbrowser plug-in units.
By taking Database Systems as an example, the list for the specific format that method shown in FIG. 1 generates, as the list of aspx formats exists
The processing for being associated background class is also needed to before use, in data system, there can be a logical background process class added, according to
The final XML data in control and configuration database in user interface, can load corresponding data from database,
Lower save button is put on a user interface, it can will be in data retrography to database.In this way, one includes the dynamic for generating list
Web page can use.
But in standalone version program, the list of this specific format cannot be directly applied.Therefore it present embodiments provides
A kind of scheme from webbrowser plug-in units to the program of list to be applied that adding, in this way, into the system of list to be applied
In such a way that inside loads, using the webclient components of .net, the static elements such as aspx format lists are captured, then
HTML forms are saved as, to obtain a static page.Then it is controlled using webbrowser in the interface of standalone version program
Part loads the page.By webbrower.document objects in the control, the value of some control can be obtained, it can also
The value of some control is set, so as to operate the information on list, reaches the function of displaying and typing.
Fig. 3 shows a kind of structural schematic diagram of the device using WORD Program Generating lists, as shown in figure 3, utilizing
The device 300 of WORD Program Generating lists includes:
Label is inserted into unit 310, is used for one or more of WORD document list, on the head of each list
It is inserted into beginning label respectively with tail portion and terminates to mark.
Control is inserted into unit 320, for being inserted into one or more controls in WORD documents, and is being inserted into each control
Meanwhile it being inserted into corresponding with control bookmark in same position and the attribute information of the control is recorded as XML format
Data.The ID of wherein each bookmark is identical as the ID of corresponding control.
Data conversion storage unit 330, for WORD documents to be saved as a html file.
List extraction unit 340, for one or more according to beginning label and end label extraction from html file
The data of each list are stored in independent html file by the data of list respectively.
List generation unit 350, for each independent html file, positioning the bookmark in the html file, according to
Bookmark ID obtains control property information corresponding with the bookmark from the data of XML format, according to the attribute information by the bookmark
Corresponding ASP.net controls are replaced with, after the stem addition page elements of the html file, which is saved as into default lattice
The list of formula.
As it can be seen that device shown in Fig. 3 utilizes easy-operating WORD programmings list by the mutual cooperation of each unit
Pattern, and using the bookmark function of WORD, wherein useful pattern can be extracted after WORD documents are saved as html file
Content is simultaneously edited, and corresponding forms pages are ultimately generated, and does not need complicated programming technique, easy to implement, is greatly improved
List formation efficiency.
In one embodiment of the invention, device shown in FIG. 1 further comprises:Monitoring unit and data acquisition list
Member;Monitoring unit, the opening event for monitoring WORD documents and preservation event;Data capture unit is further used for when prison
When measuring the opening event of WORD documents, the binary stream of one or more lists is obtained from the preset table of database, and is read
It is taken as the content of WORD documents;Data conversion storage unit, for when monitoring the preservation event of WORD documents, by WORD documents
Binary stream is output in preset table;From the binary stream a to html file for loading WORD documents in preset table.
In one embodiment of the invention, in above-mentioned apparatus, data conversion storage unit is further used for all controls
Attribute information is spliced into a final XML data;Final XML data is output in the preset table in database;List
Generation unit obtains control property information corresponding with the bookmark for inquiring preset table according to bookmark ID.
In one embodiment of the invention, in above-mentioned apparatus, data capture unit monitors WORD documents for working as
When opening event, URL files are read, obtain the two of one or more lists from the preset table of database according to the URL files
System stream;Data conversion storage unit calculates the corresponding addresses webservice for the URL interfaces according to the URL files, leads to
It crosses the corresponding webservice interfaces in the address binary stream data of WORD documents are output in preset table.
In one embodiment of the invention, device shown in FIG. 1 further comprises:List loading unit, for waiting for
Using addition webbrowser plug-in units in the program of list;The list of preset format is loaded using webbrowser plug-in units.
It should be noted that the specific implementation mode of above-mentioned each device embodiment and aforementioned corresponding method embodiment is specific
Embodiment is identical, and details are not described herein.
In conclusion technical scheme of the present invention, to one or more of WORD document list, in each list
Head and tail portion be inserted into beginning label respectively and terminate to mark, and according to demand, the suitable position insertion in WORD documents
One or more controls, and while being inserted into each control, are inserted into bookmark corresponding with the control and should in same position
The attribute information of control is recorded as the data of an XML format, and the design to list in WORD programs has been achieved, has connect down
WORD documents are saved as into a html file, according to beginning label and end label extraction one or more from html file
The data of each list are stored in independent html file by the data of a list respectively, fixed to each independent html file
Bookmark in the html file of position obtains control property letter corresponding with the bookmark according to bookmark ID from the data of XML format
Breath, corresponding ASP.net controls are replaced with according to the attribute information by the bookmark, in the stem addition page member of the html file
After element, which is saved as to the list of preset format.The technical solution utilizes easy-operating WORD programmings list pattern,
And using the bookmark function of WORD, wherein useful style content can be extracted simultaneously after WORD documents are saved as html file
It is edited, ultimately generates corresponding forms pages, do not need complicated programming technique, it is easy to implement, substantially increase list
Formation efficiency.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all
Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention
It is interior.
It should be noted that:
Algorithm and display be not inherently related to any certain computer, virtual bench or miscellaneous equipment provided herein.
Various fexible units can also be used together with teaching based on this.As described above, it constructs required by this kind of device
Structure be obvious.In addition, the present invention is not also directed to any certain programmed language.It should be understood that can utilize various
Programming language realizes the content of invention described herein, and the description done above to language-specific is to disclose this hair
Bright preferred forms.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention
Example can be put into practice without these specific details.In some instances, well known method, structure is not been shown in detail
And technology, so as not to obscure the understanding of this description.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of each inventive aspect,
Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes
In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:It is i.e. required to protect
Shield the present invention claims the more features of feature than being expressly recited in each claim.More precisely, as following
Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore,
Thus the claims for following specific implementation mode are expressly incorporated in the specific implementation mode, wherein each claim itself
All as a separate embodiment of the present invention.
Those skilled in the art, which are appreciated that, to carry out adaptively the module in the equipment in embodiment
Change and they are arranged in the one or more equipment different from the embodiment.It can be the module or list in embodiment
Member or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or
Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it may be used any
Combination is disclosed to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so to appoint
Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power
Profit requires, abstract and attached drawing) disclosed in each feature can be by providing the alternative features of identical, equivalent or similar purpose come generation
It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments
In included certain features rather than other feature, but the combination of the feature of different embodiments means in of the invention
Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed
One of meaning mode can use in any combination.
The all parts embodiment of the present invention can be with hardware realization, or to run on one or more processors
Software module realize, or realized with combination thereof.It will be understood by those of skill in the art that can use in practice
Microprocessor or digital signal processor (DSP) are according to the ... of the embodiment of the present invention using WORD Program Generating lists to realize
The some or all functions of some or all components in device.The present invention is also implemented as being retouched here for executing
The some or all equipment or program of device (for example, computer program and computer program product) for the method stated.
It is such to realize that the program of the present invention may be stored on the computer-readable medium, or can have one or more signal
Form.Such signal can be downloaded from internet website and be obtained, either provide on carrier signal or with it is any its
He provides form.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability
Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference mark between bracket should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not
Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such
Element.The present invention can be by means of including the hardware of several different elements and being come by means of properly programmed computer real
It is existing.In the unit claims listing several devices, several in these devices can be by the same hardware branch
To embody.The use of word first, second, and third does not indicate that any sequence.These words can be explained and be run after fame
Claim.