First, register the office star control
If the user downloads installed the office star control demo project, during the installation process, the installer will automatically register the office star control; if the user downloads the office star control, you need to register the control according to the following method:
Click "Start" → "Run"; enter the following command in the Run dialog:
Regsvr32
Regsvr32 / u
Second, add an office star control into the page
1) Take FrontPage 2000 as an example, execute menu "Insert -> Advanced -> ActiveX Control";
2) In the "Insert ActiveX Control" dialog box pop-up, select "Ostarocx2 Control";
3) Click the "OK" button to insert the control in the current page, generate the following code:
Value = "65536">
Value = "6773">
Value = "4366">
Value = "0">
Object>
Width and height in the first line of code refer to the width and height of the control, the ID refers to the name of the control object, and implements the control of the control through this name. Since the control is running on the client, in order to enable the client to correctly display the page correctly, add the statement in the first line of code:. This statement indicates where the client running the page will automatically download the control without installing an office star control. The example is the address of the office star control on our website, you can replace it according to your actual situation. The first code is changed as follows:
Third, use controls
After generating the control, the user can use the various interfaces of the control. Control the control interface is implemented through the VBScript or JavaSript scripting language in the ASP. The following code takes VBScript as an example:
1. Specify the file name to open the file
Function OpenDocument (filename)
Ostar.onopenfile filename
END FUNCTION
Note: FileName is a full path string of the file name, which can be a local or remote file.
2. Pop up the Open File Selection box Open Local Documentation
Public Sub MnuFileOpen_Click ()
Ostar.onopenfile ""
End Sub
3. New documentation
Public Sub Mnufilenew_click ()
Ostar.onnewfile
End Sub
4. Save the document
Public Sub Mnufilesave_click ()
Ostar.onsavefile Ostar.getPathname
End Sub
5. Print
Public Sub MnufilePrint_click ()
Ostar.onprint
End Sub
6. Print preview
Public Sub MnufilePrintpreview_click ()
Ostar.onprintpreview
End Sub
7. Print settings
Public Sub MnufilePrintSetup_click ()
Ostar.onprintsetup
End Sub
Fourth, interact with the database
The data, text content, and pictures in the office star control document can be derived from the database. Almost every object in the office star can set an alias, and the control of the object is obtained by alias. Update XML technology is implemented in the ASP. Here we don't detail, you can refer to the example "Access Picture" (
http://www.oapro.com/ostarocx/Product_Demo.asp) and download the source code (
Http://www.oapro.com/ostarocx/download/ostarocx_upfile.rar) Analysis.
V. Client operation
The client of the client is not installed, the first line of the first line of our work is running, and the dialog box will be ejected first.
Check "Install this Program" item, then click "OK" ammonium.
You must choose "Yes" ammonium but you can't successfully install the office star control, will not be able to run.
Sixth, sample
Please refer to the online presentation (
Http://www.oapro.com/ostarocx/Product_Demo.asp examples in the office star control.