1.Word Demos      2.Excel Demos      3.PowerPoint Demos      4.Demos support IE only

Note: The demos from 1.x to 3.x support all browsers. The demos 4.x only support Internet Explorer. If you make sure that all of your users will use IE, you can use Aceoffix like demos 4.x.

Example

Folder & Location

1. Word Demos
 
1.1  Edit Word document online
This is a getting started example for Word.
word/editword.jsp
1.2  View Word document in read-only mode
This demo also shows how to disable the resize function of pop-up window.
word/viewword.jsp
1.3  Generate Word report dynamically word/wordreport.jsp
1.4  Word document used as an input form word/wordsubmit.jsp
1.5  Use JavaScript to open a document online
This code can be used in AJAX. This function can also be applied to Excel and PowerPoint.
word/jsopendoc.jsp
1.6  Use JavaScript to call VBA interface of Word application
This code shows how to call VBA interface of Word application at client-side. You'd better use IE.
word/callvba.jsp
1.7  Upload a local Word document to web server
At server-side, you can not only get the document but also get its plain text.
word/uploaddoc.jsp
1.8  Concurrent control.
First John opens the document, and don't close it.
Then Mike opens the same document.
It is possible that Word or Excel file is modified by several users at the same time. Aceoffix can properly control concurrent access.
word/concurrent.jsp
1.9  Revision features.
Trace John's revisions.
Trace Mike's revisions
Check and clean up all the revisions
Forced revision mode. Different modified revisions are displayed in different colors. Revision can show who modified, when the file was modified and what was modified. User can not accept, reject and delete others' revisions. In docFinalizeDraft mode user can check and clean up all the revisions in the document.
word/revisiononly.jsp
word/revisionclean.jsp
1.10  Editable regions control.
John's editable regions.
Mike's editable regions
Users are allowed to edit the specific regions in Word document, and they cannot modify contents out of these regions.
word/editableregions.jsp
1.11  Open and save a document which is stored in database
This function can also be applied to Excel and PowerPoint document.
word/editfiledb.jsp
1.12  Open the Office document from server disk path (take Word as the example).
This document is opened from disk path on server. With this method, document can be loaded and saved to any folder in the disk on the server.
openFromDisk
1.13  Modify caption of Aceoffix control.
Caption text can be modified by assigning Caption property. If Caption property is not assigned, the default text is Aceoffix.
setCaption
1.14  Hide caption bar, menu bar, custom toolbar and Office toolbar.
This demo shows how to hide the caption bar, menu bar, custom toolbar and Office toolbar. And each bar can be hidden respectively.
controlBars
1.15  Set UI theme of Aceoffix
The UI theme of Aceoffix can be changed by setting Theme property. There are three choices, custom theme, theme of Office2007 and Office2010.
setTheme
1.16  Return the value of saving results customized by developer to front page after saving the document.
By setting the Aceoffix.FileRequest.CustomSaveResult property in code, a value customized by developer can be returned to AceoffixCtrl object in front page to determine how to process next step.
setRuturnValue
1.17  Pass parameter to the save page specified by SaveFilePage property.
This demo shows how to pass parameter to save page by assigning SaveFilePage property, using URL with query parameters and page elements, like Input and Select.
passParameters
1.18  Control save, save as and print function (take Word as the example).
This demo shows how to disable save, save as and print respectively in Office document.
fileCommand
1.19  Assign Table in Word document.
This demo shows how Aceoffix assign cells and automatically increase rows in the Table in Word.
wordFillTable
1.20  Use DataTag to fill text data in Word document.
If you want to fill many areas with the same content in a Word with Aceoffix, you can place DataTags in the Word template to mark the areas requiring same text when designing the Word template, and then use DataTag object to fill the text when running the webpage with Aceoffix.
wordDataTag
1.21  Add a button to the custom toolbar of Aceoffix (take Word as the example).
This demo shows how to add a button to the custom toolbar of Aceoffix and write the JavaScript code for the click event of this button.
customToolButton
1.22  Add a JavaScript event triggered by AceoffixCtrl in the page after opening the document (take Word as the example).
This demo shows how to add a JavaScript event triggered by AceoffixCtrl in the page after opening the document. This event is quite commonly used. You can execute your code in this event after opening the document.
afterDocOpened
1.23  Use JaveScript to hide or show each toolbar on the window of Aceoffix (take Word as the example).
This demo shows how to use JavaScript to hide or show caption bar, menu bar, custom toolbar and office toolbar respectively.
jsControlBars
1.24  Save as HTML (take Word as the example).
This demo shows how to use SaveDocumentAsHTML method to save the document as Html format and store it to server.
saveAsHTML
1.25  Save as MHT (take Word as the example).
This demo shows how to use SaveDocumentAsMHT method to save the document as MHT format and store it to server.
saveAsMHT
1.26  Trigger an event before or after saving the document (take Word as the example).
This demo shows how to trigger an event before or after saving the document. These two events are quite commonly used. You can execute your code in these two events.
beforeAndAfterSave
1.27  Use AcoeffixLink to open document online (take Word as the example).
AceoffixLink is a new way to open a document. This solution has solved cross-browser compatibility issues perfectly.
AceoffixLink
1.28  Simultaneously save the Word file and its text in the specified region (take Word as the example).
This demo shows how to use SaveDataPage and SaveFilePage methods to save the text and the file simultaneously.
saveDataAndFile
1.29  Create document (take Word as the example).
This demo shows how to use createNewDocument method to create document.
createword
1.30  Use code to insert images in DataRegion.
This demo shows how to generate a merged document by inserting images and Word files in the specified locations in the template.
wordResImage
1.31  Use code to insert Excel documents in DataRegion.
This demo shows how to generate a merged document by inserting Word and Excel files in the specified locations in the template.
wordResExcel
1.32  Set watermark in Word document.
This demo shows how to set watermark in Word document by setting Aceoffix.wordwriter.WaterMark property.Also you can set watermark by JavaScript, please click here.
setWaterMark
1.33  Run macros in document (take Word as the example).
This demo shows how to run macros in Word document by using RunMacro method of Aceoffix.
runMacro
1.34  Insert new rows in the Table in Word document and assign the new Table.
This demo shows how to insert new rows in the Table with vertical merged cells in Word document.
wordFillTable2
1.35  Get the data from the Table in Word document.
This demo shows how to get the data from the Table in Word document. Only if the Table is in one DataRegion, you can use OpenTable method of the DataRegion object to get the data in each cell in the Table.
extractTable
1.36  Set font of the text in DataRegion.
This demo shows how to use code to set the font (style, size, color and alignment) of the text in DataRegion.
dataRegionFont
1.37  Different users can simultaneously modify different regions in one Word document.
This demo shows how to control different users to modify their own regions in Word document. And this way support simultaneous modification.
wordEditByUser
1.38  Merge cells in the table in Word document by programming and set the style of the text in cell.
This demo shows how to use MergeTo method to merge the cells specified in the Table in Word document; fill text data; set the font and alignment of the text.
mergeWordCell
1.39  How to capture the click event in DataRegion.
This demo shows how to capture the click event in DataRegion to enable user to select data from drop-down box instead of editing the content in DataRegion directly. This feature can ensure the content that the user inputs is correct. You can also refer to the demo in 1.52.
clickDataRegion
1.40  Assign the DataRegion in Word and set style for it.
This is a simple example to assign DataRegion in Word. You can predefine some DataRegions in Word and the specified locations in the DataRegions will be filled automatically. You can set the font of the text in the locations too.
fillDataRegion
1.41  User defines the location of DataRegion in the template.
This demo shows how user uses the encapsulated DataRegion management window to edit template or define the location of DataRegion in the template. Please refer to 1.43 for a more detailed example about how to use DataRegion and DataTag in combination.
defineDataRegion
1.42  User defines the location of DataTag in the template.
This demo shows how user uses the encapsulated DataTag management window to edit template and define the location of DataTag in the template.
defineDataTag
1.43  How user makes or customizes the Word template and how developer uses the template to generate the formatted Word document.
This demo shows how user customizes the Word template and how to use code to generate a new formatted Word document with the updated template.
customizeTemplate
1.44  Compare two Word documents online.
This demo shows how to open two Word documents online and compare them in shifting display or simultaneous display.
wordCompare
1.45  Assign the DataRegion in the textbox in Word document.
This demo shows how to assign the DataRegion in the textbox in Word document and fill data to some special location in Word document.
wordTextBox
1.46  Control the Ribbon bar of Word.
This demo shows how to hide and display the buttons, tabs and functional groups in the Ribbon bar in Word.
wordRibbonCtrl
1.47  Add new comments in two ways and navigate comments list.
There are two ways to add new comments, using WordInsertComment method or using RunMacro method to call VBA. Using RunMacro method to call VBA interface to show comment list on page and clicking the comment list to locate every comment in Word.
commentlist
1.48  Show revision list in Word document.
This demo shows all revisions of the current document in list. When click each revision in the revision list, you will be navigated to the corresponding page directly.
revisionlist
1.49  Dynamically create tables in Word and assign them.
This demo shows how to dynamically create many tables in Word document and assign those tables.
wordCreateTable
1.50  Execute the Macro commands (VBA) with return value in Word document (take Word as the example).
This demo shows how to use RunMacro method of AceoffixCtrl to execute the macro commands (VBA) of Word and get the return value.
runMacro2
1.51  Dynamically generate an examination paper in Word document.
This demo shows how to generate a examination paper with some questions from question bank. You can generate the paper by JavaScript or by creating DataRegion dynamically. The later method will be simpler in code.
examinationPaper
1.52  A demo of Absence Request
This demo shows how to fill Word template to generate a formatted document; how to get data from Word document and store them to database on server; and how to control the editable regions in Word document by specifying the editable regions and how to enable user to select data from drop-down box instead of editing the content in DataRegion directly.
wordForm
1.53  Only using code to create a formatted Word document from a blank file.
This demo shows how to call the classes provided in Aceoffix.WordWriter namespace and use code to create a formatted Word document with images and text from a blank file.
wordParagraph
1.54  Apply the predefined template to current document by one click.
This demo shows how to apply the predefined template to the current document by filling data.
applyTemplate
1.55  Delete the row where the cursor is in the table in Word document.
This demo shows how to use JavaScript to call VBA interface of the Word to delete one row.
deleteRow
1.56  Hide the ruler in Word document.
This demo shows how to use JavaScript to call the VBA interface of the Word to hide the ruler in Word document.
hideRuler
1.57  Insert bookmark in where the cursor is in Word document.
This demo shows how to use JavaScript to call the VBA interface of the Word to insert bookmark in Word document.
jsWordAddBM
1.58  Locate the cursor to where the bookmark is.
This demo shows how to use JavaScript to call the VBA interface of the Word to locate the cursor to where the bookmark is.
jsWordLocateBM
1.59  Insert Hyperlink in Word document.
This demo shows how to use JavaScript to call the VBA interface of the Word to insert Hyperlink in Word document.
wordHyperLink
1.60  Merge the cells of table in Word document.
This demo shows how to use JavaScript to call the VBA interface of the Word to Merge the cells of table in Word document.
jsWordMergeCell
1.61  Get the text selected in Word document.
This demo shows how to use JavaScript to call the VBA interface of the Word to get the text selected in Word document.
jsWordGetSelection
1.62  Jump to the specified page in Word.
This demo shows how to use JavaScript to call the VBA interface of the Word to jump to the specified page and get the number of all pages in the document.
jsWordGotoPage
1.63  Insert page break in where the cursor is in Word document.
This demo shows how to use JavaScript to call the VBA interface of the Word to insert page break in where the cursor is in Word document.
jsInsertPageBreak
1.64  Split word document.
When saving a Word document, the content in the DataRegion whose property is SubmitAsFile = true can be extracted and saved as a single word file.
wordSplit
1.65  Merge word document.
By programming, many Word documents can be inserted in the specified locations in a template to generate a merged document when opening the Word template online.
mergeWord
1.66  Create DataRegion.
Using CreateDataRegion method to dynamically create DataRegion and generate a merged document by inserting many Word documents in specified locations in a template when opening the Word template online. And this method can also generate a Word document with text and images in a blank Word document, which is more flexible and easier.
createDataRegion
1.67  Save document automatically.
This example shows how to auto-save document, in case that a document is left opened for a period of time and forgotten to be saved.
autoSave
1.68  Use Button to load and display document in HTML.
This example shows how to show Aceoffix on HTML page(No any server code) by clicking button.
showOnHtml
1.69  This example shows how to only disable Copy, Save as, F12 in Word and leave the document still editable.
The difference between DisableCopyOnly and AllowCopy: With DisableCopyOnly property, you can only disable Copy, Save as, F12 in Word, and the document is still editable. With AllowCopy property, you can disable Copy, Save as, F12, and the document is not editable.
disableCopyOnly
1.70  Developer can define whether the window will be closed based on whether the document is modified.
Since Onunload and Onbeforeunload event in javascript are invalid in many browsers, they cannot stop users closing the window. This issue can be solved by the "BeforeBrowserClosed()" event.
beforeBrowserClosed
1.71 Pass a long parameter to web page with Aceoffix.
Typically, you can pass a parameter by URL querystring. For example: word/editword.aspx?msg=hello. But if the parameter is very long, it will exeeds the length limitiation of URL. At here, you can learn how to pass a long parameter without length limitation.
word/passparam.jsp
1.72 Call-back Javascript functions from the parent page(take Word as the example).
Call-back Javascript functions from the parent page. This feature can be used to update the state of parent page or return a result to parent page when the child page is closed.
callParentJS/index.html
1.73 Convert Office document to a PDF file (take Word as the example).
This example shows how to covert a Word document to a PDF file and save it to server.
SaveAsPDF/WordToPDF.jsp
1.74 Shows how to open document with full screen window (take Word as the example).
There are two solutions for full screen. Solution1.   Solution2.
fullscreen
1.75 Convert Word documents to PDF files in batch.
This example shows how to covert Word documents to PDF files in batch.
convertPDFs
1.76  Comment only.
Comment only mode. In this mode, user only can insert comments and can not modify any content in the document.
commentOnly
2.Excel Demos  
2.1  Edit Excel document online
This is a getting started example for Excel.
excel/editexcel.jsp
2.2  View Excel document in read-only mode
excel/viewexcel.jsp
2.3  Generate Excel spreadsheet dynamically excel/excelreport.jsp
2.4  Excel spreadsheet used as an input form excel/excelsubmit.jsp
2.5  Use JavaScript to call VBA interface of Excel application
This code shows how to call VBA interface of Excel application at client-side. You'd better use IE.
excel/callvba.jsp
2.6  Assign the cells in Excel.
This demo shows the simplest way to assign the cells in Excel.
excelFillCell
2.7  Assign the table in Excel and increase rows automatically with predefined style.
This demo shows how to use OpenTable method to increase rows and repeatedly format them with the style of Table region (B4:F13).
excelTable
2.8 Merge cells in Excel document by programming; assign the new merged cell and set its format.
This demo shows how to merge the cells specified in Excel document; assign the new merged cell and set its format.
mergeExcelCell
2.9  Different users can simultaneously modify different regions in one Excel document.
This demo shows how to control different users to modify their own region in Excel document. And this method support simultaneous modification.
excelEditByUser
2.10  Draw table line in Excel by programming.
This demo shows how to set the style of the Table line by programming.
setExcelCellBorder
2.11  Set the font, color, alignment and background color of the text in the cells of Excel by programming.
This demo shows how to set the font, color, alignment and background color of the text in the cells of Excel by programming.
setExcelCellText
2.12  Capture the click event on the cells in Excel.
This demo shows how to capture click event on the cells in Excel to enable user to select data from drop-down box instead of editing the content in the cells directly. This feature can ensure the content that the user inputs is always correct.
clickExcelCell
2.13  Assign the cells in Excel and set the text color.
This demo shows how to fill data in the cells in Excel and set the text color by programming.
excelFillCell2
2.14  Assign the cell with defined name in the Excel template.
Excel has "Define Name" function. With this function, you can define name to any cell, for example, name a cell "testA". This demo shows how to assign the cell named "testA".
definedNameCell
2.15  Assign the table with defined name in Excel template.
Excel has "Define Name" function. With this function, you can define name to any Table (to clarify the functions of Aceoffix, we call a region in Excel as a Table), for example, name a Table (B4:F13) "report". This demo shows how to assign the Table named "report".
definedNameTable
2.16  Control the Ribbon bar in Excel.
This demo shows how to hide and display the buttons, tabs and functional groups in the Ribbon bar in Excel.
excelRibbonCtrl
2.17  Only using code to create a formatted Excel document from a blank file.
This demo shows how to call the classes provided in Aceoffix.ExcelWriter namespace and use code to create a formatted Excel document with complex formulas, table lines, and colored text from a blank Excel file.
drawExcel
2.18  Use JavaScript to get and set the value in cells in Excel.
This demo shows how to use JavaScript to call the VBA interface of Excel to set and get the value in the cells specified in Excel document.
jsExcelCell
3.PowerPoint Demos  
3.1  Edit PowerPoint document online
This is a getting started example for PowerPoint.
powerpoint/editppt.jsp
3.2  View PowerPoint document read-only
powerpoint/viewppt.jsp
4.Demos support IE only
The only difference between supporting all the browsers and supporting Internet Explorer is the hyperlink. Support all the browsers by using the following link.
<a href="javascript:AceBrowser.openWindowModeless('word/editword.jsp', 'width=1200px;height=800px;');"> Edit Word document online</a>
Only support Internet Explorer by using the following link.
<a href="word/editword.jsp"> Edit Word document online</a>
 
4.1  Edit Word document online
This is a getting started example for Word.
word/editword2.jsp
4.2  Use Button to load and display document in HTML.
This example shows how to show Aceoffix on HTML page(No any server code) by clicking button.
showOnHtml
   
uparrow