Maneuver Your Solution to Microsoft Office 97
Scott Horn
Product Manager, Office 97 Developer Edition
You’ve heard about Microsoft Office 97 and the new Office 97, Developer Edition. Now you’re eager to start building great new solutions, but what about your solutions that were built with an earlier version of Office? Although most solutions will migrate to Office 97 with no changes, your solution may be one of a small percentage that will need some changes to run under Office 97, or you may even want to update your code just to take advantage of some of the new features in Office 97. This article looks at what you need to know to update your solution to Office 97 and what resources are available to help you.
Any required solution changes fall into one of three categories: differences between 16-bit and 32-bit platforms; changes needed to support new common Office 97 components; or changes needed to support new Office 97 features.
Determining Whether Your Solution Will Need Modification
The table at the end of this article lists categories of pre-Office 97 solutions that may require some modification to run in Office 97. The following list quickly covers each type of solution and provides pointers for more detailed information.
API and DLL References: Some solutions created with 16-bit Office applications include references to 16-bit Windows APIs and DLLs. Office 97 is completely 32-bit, so your solution will be running on a 32-bit operating platform if it is running under Windows. If your solution is already running on a 32-bit Windows platform, either Windows 95, Windows NT 3.51, or Windows NT 4.0, this issue doesn’t affect your solution; otherwise all 16-bit API and DLL references must be replaced with equivalent 32-bit API or DLL references. This change is required for all solutions that include 16-bit API or DLL calls.
Visual Basic for Applications 5.0 (VBA 5.0) is greatly improved over previous versions and is now included in Microsoft Word, Microsoft PowerPoint, Microsoft Access, and Microsoft Excel. VBA 5.0 provides new capabilities, including a programmable development environment and IntelliSense technology that assists developers in building solutions. Developers who move their solutions to Office 97 are also moving to VBA 5.0 and should be aware of differences between VBA 5.0 and previous VBA versions and VBA variants (Access Basic, WordBasic).
Solutions written in either Access Basic or WordBasic are automatically converted to VBA 5.0 when a Microsoft Access database (.MDB) or Word document (.DOC) is opened in Microsoft Access 97 or Word 97. The conversion is not permanent until the updated file is saved. Many Access developers migrated their solutions to VBA when they moved to Access 95 and are not affected by moving to VBA 5.0. Microsoft Access and Word conversion has been extensively tested on customer-supplied solutions and converted solutions should run unmodified. It is possible that a small percentage of converted WordBasic code will generate compilation errors due to the stronger type checking in VBA ("type mismatch" errors) and by WordBasic code that was not executed or flagged as a syntax error. Correcting these errors usually involves changing a variable type declaration or adding explicit type conversion to code that has generated a compilation error.
Previous versions of Microsoft Excel included VBA code in a module within a Microsoft Excel workbook. VBA 5.0 code is now stored in a VBA project within a Microsoft Excel workbook rather than being in a workbook module sheet. All previous VBA modules are automatically converted to VBA 5.0 projects, but solutions that have explicit references to a specific workbook VBA module will need to be updated.
Microsoft Outlook 97 is the new programmable desktop information manager in Office 97. It replaces Schedule+ from Office 95 and adds email, task, and contact management along with scheduling capabilities to Office 97. Developers can continue to use Schedule+, but Outlook has more capabilities and enhanced programmatic control, so developers will benefit from upgrading. Schedule+ information can be easily imported into Outlook and Outlook scheduling works with people who use Schedule+.
OfficeArt is a new shared graphics and drawing component that is completely programmable, OfficeArt replaces previous drawing tools in Office, including Word Art and the PowerPoint graphics features. Solutions that rely on these older tools will need to be updated using OfficeArt.
Command Bars is a new shared programmable component that replaces toolbars and menus. Command Bars provide all the features of toolbars and menus, while extending them to add new capabilities such as easily attaching code to toolbar buttons or dynamic menu creation. Solutions that use Windows API calls to manipulate toolbars and menus will need to be updated to use Command Bars.
Microsoft Forms: The new Office forms design environment is included in Visual Basic for Applications 5.0. This environment supports programmable form events and exposes an object model for the design environment. Forms created with Microsoft Forms can be reused across multiple Office applications. Microsoft Forms includes support for the more than 2,000 ActiveX controls (formerly OLE controls) available today and replaces all older dialog and form creation tools such as the Microsoft Word Dialog Editor. Older Word dialog boxes will continue to work in Word 97, but the Word Dialog Editor is not included in Word 97, so developers must use the Microsoft Forms environment to create new dialog boxes or modify older Microsoft Word dialog boxes.
Microsoft Excel 97: Microsoft Excel 97 adds many new end-user and developer features, including a programmable object model for the Data Map geographical charting component, new chart types, and a finer degree of control over PivotTables. Minor changes have been made to the Microsoft Excel 97 object model to support these new features as well as the addition of common components such as Command Bars. Developers should review the Microsoft Excel 97 migration information referenced below for further details.
Microsoft PowerPoint 97: The PowerPoint 97 object model has been refined to increase its consistency with other Office 97 object models and to incorporate new components such as OfficeArt and Command Bars. Developers should review the PowerPoint 97 migration information referenced below for further details.
What to Do Next
Get More Information: There are a number of resources available to assist developers in moving their solutions to Office 97. The Office Developer Forum (http://www.microsoft.com/officedev/) is a great place to learn about the new developer features in Office 97. It includes a Making the Move to Office 97 Web page with free white papers and code samples for migrating solutions. The table below provides pointers on specific migration options to use based on the type of solution involved and a list of helpful papers that are available on the Office Developer Forum. These papers will be also available on an upcoming MSDN library release.
Review Your Code: Visual code inspection is worth the time it takes to do. Several issues outlined above, including type mismatches and 16-bit references, can be easily detected and corrected during visual code inspection.
Convert Your Solution and Evaluate: One plan is to just try your code in Office 97. Your solution may not require any changes to run, or it may be converted and need no further changes. But first—MAKE A BACKUP OF YOUR SOLUTION! Then try it under Office 97 and use the enhanced VBA 5.0 development environment to make any changes needed.
Welcome to Office 97
Office 97 delivers more new capabilities than any previous release—especially for developers. All the features in Office 97 are programmable and can be reused in custom solutions. VBA 5.0, Outlook 97, and ActiveX control support are just a sample of the new capabilities in Office 97. Developers who migrate their solutions to Office 97 will find that the trip was well worth it.
Office 97 Solution Migration Resources
Category | Current Solution: | Use This in Office 97 | For More Information |
Platform Differences | Microsoft Office solution with calls to 16-bit Windows APIs, 16-bit DLLs | Equivalent 32-bit DLLs or Windows API references | "Porting Your 16-Bit-Based Microsoft Office-Based Solutions to 32-Bit Office" (paper) |
New Common Office Components | Pre-Microsoft Office 97 solution with Visual Basic for Applications code | "Visual Basic for Applications 5.0 (VBA 5.0) to Excel 97" and "Migrating Solutions" | "WordBasic Migration to Visual Basic for Applications" and "Migrating Solutions to PowerPoint 97" (papers) |
Schedule+ solution | Outlook 97, the new desktop information manager in Office 97 | "Microsoft Outlook 97: Interoperability with Microsoft Exchange Client, Microsoft Mail Version 3.X, Microsoft Schedule+ 95, and Microsoft Schedule+ Version 1.0" (paper) | |
Microsoft Access solution written in Access Basic | VBA 5.0 | "Migrating to Access 97" Q&A | |
Microsoft Word solution written in WordBasic | VBA 5.0 | "WordBasic Migration to Visual Basic for Applications" (paper) | |
Microsoft Word solution that includes Word dialog boxes | Microsoft Forms (part of Visual Basic for Applications 5.0), the new Office forms design environment | Office 97 Visual Basic Programmer’s Guide | |
Microsoft Excel solution that relies on VBA code residing in a workbook module | VBA 5.0 as a separate MDI window in Office 97 | “Migrating Solutions to Excel 97” | |
New Office Features | Pre-Microsoft Office 97 solution using drawing capabilities (Word Art, PowerPoint graphics) | Office Art, the new shared graphics component in Office 97 | Office 97 Visual Basic Programmer’s Guide, "Migrating Solutions to Excel 97," and "Migrating Solutions to PowerPoint 97" |
Microsoft PowerPoint 95 solution that uses the PowerPoint object model | Object model exposed by PowerPoint 97, improved to accommodate new features and Office components | "Migrating Solutions to PowerPoint 97" | |
Microsoft Office solution that uses Windows API calls to manipulate application menus or toolbars | Command Bars, a new common and programmable Office component that replaces menus and toolbars in Office 97 | "Replacing API Calls That Manipulate Menus" (article) |