• <abbr id="ck0wi"><source id="ck0wi"></source></abbr>
    <li id="ck0wi"></li>
  • <li id="ck0wi"><dl id="ck0wi"></dl></li><button id="ck0wi"><input id="ck0wi"></input></button>
  • <abbr id="ck0wi"></abbr>
  • <li id="ck0wi"><dl id="ck0wi"></dl></li>
  • Home >

    The Method Of Graph Document Management Based On Word

    2008/6/6 16:31:00 42050

    In engineering practice, a large number of graphic documents are widely used, such as DWG, DXF format graphics files, BMP, TIF, JPG format image files, TXT.DOC format text files, STEP files and voice documents.

    This document is classified according to certain classification coding rules and named after the classification code number.

    In order to manage them, this article will introduce an application developed under the Visual Basic environment, through which the Word format management document can be generated automatically, and the management of the graph documents can be realized.


    To automate the operation of Word documents, it can be completed in the automation tool Word, but Word must be used in Word instead of application system development.

    The ActiveX component technology can be used to control Word automatic completion of document operation in VB.

    The method is to insert the document into the Word document in sequence and label the map number, and then generate the directory.

    Through this automatically generated management document, the management of batch drawing documents can be realized, and the directory can be conveniently located and located to the required documents.

    After double clicking the required document, the document is activated.


    This method of document management is simple and practical.

    For image files, you can easily find, locate, preview and edit.

    The printing time of batch drawing can also be saved by using Word printing function.

    Next, the related principles and techniques will be introduced in detail.


    1 operate Word documents in VB


    1.1 ActiveX component technology overview


    The ActiveX component is a reusable programming code and data consisting of one or more objects created by ActiveX technology.

    VB applications can use existing components, such as components contained in Microsoft Office applications, code components provided by various manufacturers, ActiveX documents, or components contained in ActiveX controls.

    In addition, it can also develop ActiveX controls on its own.


    ActiveX components can effectively integrate existing and perfect application fragments.

    The use of ActiveX components can make use of the functions provided by many other Windows applications in its own applications, such as Microsoft Excel, Microsoft Word and Microsoft Access, which provide objects that can be manipulated through VB applications.

    In this way, developers can use Excel's electronic data sheets, Word documents or Acces, database properties, methods and events in their own applications.


    1.2 VB method of operating Word documents


    The objects provided by ActiveX components are very similar to those that operate on other objects.

    In VB applications, before using the component object, we first add the reference to the component in the project, declare the object variable, assign the object reference to the variable, and then write the code of the object's method, attribute and event.

    The way to operate Word documents in VB is as follows.


    (1) add references to components.

    From the Project menu, select reference and add a reference to "Microsoft Word 8 Object Library" in the reference dialog box.


    (2) declare the Word object variable in the program and assign the object reference to the variable as follows.


    Dim wdAppl As Word.Application declares object variables for Word applications.


    Set wdAppl=New Word Application assigns object references to the variable.


    The object variable in the object reference is declared as a specific class variable wdAppl, and the object reference is pre - bound.

    If an object reference object variable is declared a general Object class variable, then object reference is binding afterwards.

    For example, you can also give references to Word objects to the following Object class variable wdApp2


    Dim wdApp2 As Object post binding


    Set wdApp2=Create0bject ("Word.Application")


    Usually, the code that bound the variable wdApp2 after execution is slower than using the wdApp code of the pre bound variable 1.

    This is because, when declaring a variable As Object, VB cannot determine the nature of the object reference contained in the variable during compilation.

    In this case, VB must use post binding, that is, when VB is running, it can determine whether the object has the properties and methods to be used in the code.


    (3) use the properties and methods of Word objects.

    After the Word object reference is assigned to the object variable, it can use the variable to manipulate the attributes and methods of the object.

    The properties and methods of using Word part objects are no different from normal objects.


    The objects provided by components are generally hierarchical.

    Office applications and other ActiveX components provide a top-level external creation object at their object level, which provides access to other objects in the hierarchy and methods and attributes that work for the entire application.


    For example, each Microsoft Office application provides a top-level Application object that can access the subordinate objects in each application and the properties and methods of this object.

    For example, the Word document segmentation operation is implemented by the TypeParagraph method of the Selection of the Application object.

    The code is:


    WdApp 1.Selection.Typelaragraph


    In program development, I, if you want to use the attributes and methods of Word objects to accomplish some automatic operation of Word documents, a convenient way is to use the internal recorder in Word to record the operation process of the corresponding manual Word documents, and the recorder can automatically create inside.

    Word first recorded inside as a series of macro codes represented by VBA (Visual Basic for Applications).

    Then the user can copy the recorded macro code to the VB application in the "Visual Basic editor". Because VBA is a subset of VB, it only needs a little modification to realize the automatic operation of the Word document in the VB program.

    However, not all manual operations can be recorded, and the internal recorder can not record the movement of the mouse in the document window.

    For example, you cannot use mouse to move the insertion point, or select, copy, or move items by clicking, dragging, and so on.

    To record such operations, you must use shortcut keys.


    In this process, because of the operation of document fire and document, the SFO object model is used. This model provides object based tools to handle file fires and files.

    You need to reference objects before they have properties, methods, and events.

    The referencing method is to select the reference command on the Project menu, and then select the Microsoft Scripting Runtime check box.

    Creating FSO objects can be accomplished by declaring a variable as a FileSystemObject object type, for example:


    Dim FSO As New FileSystem


    2 program design and Implementation


    2.1 implementation of document management steps


    (1) classification and coding of graph documents.


    The classification and coding of documents will help to manage them.

    The classification and coding of the system documents are carried out in 2 segments.

    The first segment is the 3 bit category code and the second segment is the 3 bit identifier.

    Category codes are used to categorize document categories, and identifiers are used to distinguish documents of the same class. Therefore, a document can be uniquely identified by category codes and identifiers.

    The file name prefix of a document is named after its category code and identification code.

    If the classification code of a document is 22_275, its 220 is its category code and 275 is its identification code, its file name prefix is 220_275..


    (2) automatically generate Word management documents.


    In the program, you can create a map document management directory, add the document you need to manage to the management directory, or delete the document from the management directory, I, and then automatically generate Word management documents according to the graph files in the management directory.

    The process of generating management documents is: first, start the Word program, select the foreground running or the background running in advance, then create the new Word document, insert the map document into the Word document in order of code, and mark the map number, the map number is in line with the code number, then generate the directory number in the front part of the Word file, finally save the Word document and close Word.


    Through this automatically generated management document, the management of batch drawing documents can be realized.

    You can easily locate and locate the required document through the directory of figures, and you can activate and edit the document after you double-click the required document.


    2.2 insert method for drawing document


    The methods of inserting graph documents into Word documents can be summarized as follows: insertion, embedding, and linking.

    In the process of automatic generation of Word management documents, the effect of inserting different graph documents is different.


    (1) insertion method.

    Unlike the other 2 methods, this method is only applicable to image files.

    A 13.6*6.7cm, 24 color, JYG format picture A is inserted into the Word document after the insertion method is 36KB.

    After inserting the image file into the Word document, the picture can be restored, but the restoration effect is not satisfactory.

    The insertion method is implemented by using the AddPicture method of the Selection object's sub object lnlineShapes in the VB program.


    (2) embedding method.

    Common drawings and documents can be inserted into the Word document by this method.

    The picture A is inserted into the Word document after inserting into 4061KB, and the picture can be restored.

    Although the number of embedded files is large, the biggest advantage is that you can double click on the Word file and quickly activate the document to browse or edit directly.

    This insertion method can be used for batch printing of image files with high definition requirements.

    The embedding method is implemented in the VB program by using the AddOLEObject method of the Selection object's subobject lnlineShapes.


    (3) link method.

    The difference between the method and the embedding method lies in the location of data and the way of updating it after inserting it into Word document.

    In link method, the modification of source files will be reflected in Word documents.

    The image A is inserted into the Word document by the linking method. After 394KB, the picture is not recoverable.

    For the management of non image files or larger audio-visual files, such as PDF, DOC, you can use this insertion method and display the files in the Word document in the form of icons. Inserting Word documents is just an icon representing the content of files.

    This can make the generated Word document occupy less space.

    The operation of the link method is also implemented in the VB program by using the AddOLE0dject method of the Selection object's subobject lnlineShapes, and its parameter Link1olile is set to True.

    If you want to insert it in the form of an icon, the parameter DisplayAsleon is set to True.


    3 Summary


    This paper introduces a method of automatically generating Word documents through VB application to manage the document.

    This method is simple and practical by using macro recorder to record manual operation and generate macro code.

    You can also use VB to operate other Office applications such as Excel and Access.

    This application of Office tools in programs is very extensive.

    In fact, when you use Delphi to implement similar operations, you can also use macro code, but you need to convert the macro code represented by VBA into a form that is in line with Pascal syntax.

    • Related reading

    Preservation And Maintenance Of Electronic Files

    Document management
    |
    2007/8/4 11:00:00
    41333

    Utilization And Management Of Electronic Archives

    Document management
    |
    2007/8/4 10:59:00
    41399

    Management Of Audio-Visual Archives

    Document management
    |
    2007/8/4 10:57:00
    41535

    What Kind Of Archives Have Preservation Value?

    Document management
    |
    2007/8/4 10:55:00
    41380

    Compilation Of Statistical Report Forms

    Document management
    |
    2007/8/4 10:54:00
    41570
    Read the next article

    Website Construction And Maintenance Contract

    Party A: Party B: with the friendly negotiation between Party A and Party B, according to the relevant stipulations of the existing laws and regulations on contracts, intellectual property rights and network management, we have reached the following agreements on the construction and maintenance of Internet website: first, the contents of the design are as follows: two, web design project and price. ..

    主站蜘蛛池模板: 亚洲第一区在线| fabu14.xyz| 打扑克又痛又叫原声| jizzjizz国产精品久久| 嗯~啊太紧了妖精h| 成品网站nike源码1688免费| 色综合久久88| 亚洲国产日韩精品| 国产资源在线视频| 精品欧洲AV无码一区二区男男 | 亚洲一区爱区精品无码| 国产精品国产亚洲精品看不卡 | 国产99在线a视频| 欧美xxxx狂喷水| 国产欧美日韩另类一区乌克兰| 免费黄色网址入口| 无码国产色欲XXXXX视频| 日本高清xxxxx| 亚洲午夜久久久久妓女影院| 国产精品无圣光一区二区| 猴哥影院在线播放视频| 中文在线а√天堂| 国产亚洲精品国产福利在线观看| 无码精品国产一区二区三区免费| 精品理论片一区二区三区| a成人毛片免费观看| 亚洲人精品亚洲人成在线 | 国产激爽大片高清在线观看| 久久精品免视看国产成人| 国产真实乱16部种子| 欧美40老熟妇| 黑人操亚洲美女| 一级一片免费视频播放| 亚洲欧美日韩国产综合高清| 夜夜爽77777妓女免费看| 欧美一区二区日韩国产| 美女色又黄一级毛片| 中文字幕在线观看91| 亚洲欧美不卡视频在线播放| 国产精品嫩草影院在线看| 日本三级在线观看免费|