The information in this article applies to:
SUMMARYThe Microsoft Office Developer's Kit (ODK) includes several useful samples for Visual Basic Programmers. This article summarizes the sample applications included in the ODK. MORE INFORMATIONChartDem: Demonstrates the Microsoft Excel 5.0 Chart ObjectsChartDem uses a Microsoft Visual Basic version 3.0 interface with the OLE control to display all of the objects related to Microsoft Excel charts. The user can select objects by name from drop-down lists or enable a timer that cycles through the objects.The code for ChartDem demonstrates several OLE Automation techniques for integrating Visual Basic version 3.0 with Visual Basic for applications:
Encore: An Integrated Solution Using OLE and Microsoft OfficeEncore is a sample application developed using Microsoft Visual Basic for applications and Microsoft Office. It is a forecasting tool for Encore Musical Instruments, an international firm. By using OLE, Encore demonstrates the ease in creating custom solutions among multiple applications.From Microsoft Excel, Encore uses OLE Automation Objects and Visual Basic for Applications macros both to access sales-planning data in Microsoft Project and to create and distribute forecast reports in Microsoft Word. Another innovation of the Encore application is its use of pivot tables, a new feature of Microsoft Excel 5.0 that allows you to summarize large amounts of data using format and calculation methods of your choice. Encore incorporates the functionality of Microsoft Excel version 5.0, Microsoft Word version 6.0, and Microsoft Project version 4.0. FindXL: A Utility that Locates Hidden Instances of Microsoft ExcelControlling OLE objects in Microsoft Excel from Microsoft Visual Basic version 3.0 is one of the many ways to use the OLE Automation capabilities of Microsoft Office to create custom applications. While developing and testing applications created in this way, a run-time error in Visual Basic version 3.0 may leave a hidden instance of Microsoft Excel running, invisible to the Task Manager. FindXL is a simple tool for locating such hidden instances and making them visible.Visual Basic version 3.0 Professional Edition contains a tool, WPS.EXE, for finding and eliminating dynamic-link libraries and hidden executable files, but that tool provides neither a graceful exit nor an opportunity for examining the state of the hidden executable file. By making the hidden instance of Microsoft Excel visible, FindXL allows you to look at the property settings of the OLE objects at the time of the error. The Visual Basic version 3.0 source code for FindXL demonstrates the use of the GetObject function with the Microsoft Excel Application object. Help Desk: Demonstrates OLE Between Visual Basic and Microsoft ExcelThe Help Desk sample application is a Microsoft Visual Basic version 3.0 program that demonstrates OLE functionality by manipulating Microsoft Excel 5.0 Automation objects. It is a way to effectively manage software support. With this application, you can manage the names of software systems, information on technical service representatives using Help Desk, the names and phone numbers of contacts for whom the system is developed, and details of technical-service requests or calls about a system. An integral part of the application is the call-reporting functionality provided by an embedded Microsoft Excel 5.0 worksheet in which call data can be displayed and charted. Help Desk was built using Microsoft Visual Basic version 3.0 and incorporates the functionality of Microsoft Excel version 5.0. Invoice: Demonstrates OLE 2 Between Visual Basic 3.0 and Word 6.0The Invoice sample application is a Microsoft Visual Basic version 3.0 program that demonstrates OLE functionality by manipulating Microsoft Word version 6.0 Automation objects to print invoices. For a single invoice, a form is printed using OLE Automation. The Microsoft Word Mail Merge feature is used when printing multiple (or batch) invoices.An innovation of the Invoice application is its use of form fields, a new feature of Microsoft Word version 6.0 that allows you to print the invoice information as a custom form or as a preprinted form. Invoice was built using Microsoft Visual Basic version 3.0 and incorporates the functionality of Microsoft Word version 6.0. Mailing List: Demonstrates OLE Between Visual Basic 3.0 and Word 6.0The Mailing List sample application is a Microsoft Visual Basic version 3.0 program that demonstrates OLE functionality by manipulating Microsoft Word version 6.0 Automation objects.With this application you can manage the names and addresses of individuals, the names of mailing lists, and any association between them. It enables you to easily perform mail merge operations using the data records of individuals in a mailing list and a Microsoft Word version 6.0 document. Mailing List was built using Microsoft Visual Basic version 3.0 and incorporates the functionality of Microsoft Word version 6.0. MenuDemo: Demonstrates Various Microsoft Excel ObjectsMENUDEMO.XLS is a Microsoft Excel workbook that demonstrates manipulation of several of the OLE Automation objects exposed by Microsoft Excel, using Visual Basic, Applications Edition. Most of the procedures in the workbook are excerpts from the object reference topics in "Programming Integrated Solutions with Microsoft Office," Chapter 4, "Microsoft Excel Objects."The workbook contains modules and worksheets illustrating the following objects:
Northwind Management System: An Integrated Solution Using Microsoft OfficeThe Northwind Traders Management System sample application demonstrates how to program an integrated solution using the following applications:
The data resides in a Microsoft Access database (NWIND.MDB) and is shared with a Microsoft Excel workbook (NWIND.XLS). The sample application displays and manipulates this data using OLE Automation objects and code that resides in a Visual Basic application (NWIND.EXE). News articles are displayed using Microsoft Word (NWIND.DOC) in an OLE Automation object. The Northwind Traders Management System application was built using Microsoft Visual Basic version 3.0 and incorporates the functionality of Microsoft Excel version 5.0, XLODBC.XLA, and Microsoft Word version 6.0. OLEDB: Demonstrates Storing and Retrieving OLE Objects in a DatabaseNOTE: This reference to OLEDB is just a sample named OLEDB and does not have anything to do with OLE DB technology introduced by Microsoft.The OLEDB sample application is a Microsoft Visual Basic version 3.0 program that demonstrates OLE functionality by manipulating data access objects. OLEDB allows you to add, delete, view, and edit OLE objects in a Microsoft Access database. The database can contain Word documents, Microsoft Excel spreadsheets, wave files, bitmaps, text files, and so on. OLEDB demonstrates the use of the Visual Basic GetChunk() and AppendChunk() methods to store and retrieve large amounts of data in a Microsoft Access binary field. The OLEDB.BAS file contains reusable Visual Basic routines for storing and retrieving OLE objects, files, or any other data. OLEDB was built using Microsoft Visual Basic version 3.0. SetObjNm: A Single Function that Changes Object Names in Microsoft ExcelSETOBJNM.XLA is a simple but useful example of an add-in. Its purpose is to make it easy to change the default name of a graphic object, such as a button on a dialog sheet, from "Button 2" to "cmdOK" or whatever your coding standards dictate. On installation, the add-in puts a toolbar button on the Forms toolbar, using the ToolTip text "Set Object Name." Selecting a graphic object and clicking the Set Object Name button displays the default name of the object and allows you to change it.The source file, SETOBJNM.XLS, demonstrates the following:
SetObjNm incorporates the functionality of Microsoft Excel version 5.0. VisiBase: Demonstrates OLE Between Visual Basic 3.0 and Microsoft Word 6.0The VisiBase sample application is a Microsoft Visual Basic version 3.0 program that demonstrates OLE functionality by manipulating Microsoft Word version 6.0 Automation objects.This application enables you to modify data about each employee in a company, including a scanned photograph of the employee and a brief biography. This data, along with the photo, is automatically inserted into a Microsoft Word template, ready for publication in a company newsletter. The same Visual Basic front end could be used, with minor modifications, to automate the creation of security ID badges, a yearbook, and so on. VisiBase was built using Microsoft Visual Basic version 3.0 and incorporates the functionality of Microsoft Word version 6.0. Additional query words: examples programs
Keywords : kbprg IAPOLE vbwin |
Last Reviewed: November 3, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |