Packaging Your Solutions

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Packaging is the act of creating a package that can install your solution onto the user's computer. A package consists of one or more .cab files that contain your compressed project files and any other files the user needs to install in order to run your solution. These files may include setup programs, secondary .cab files, or other needed files.

You can freely distribute any redistributable solution or component that you create with Microsoft Office. Note that because FrontPage and Outlook only support projects that are based on user profiles, the Package and Deployment Wizard cannot package or deploy solutions using these products. You can, however, package and deploy any stand-alone project, such as Add-in projects, created in the Visual Basic for Applications (VBA) environment regardless of the application used.

In addition to document, spreadsheet, workbook, or other Office files, your solution might require other files you've created, such as DLLs, ActiveX® controls (.ocx files), or bitmaps (.bmp files). You can also include the Microsoft Access Run-Time and Graph9.exe with your packaged solution if needed. The Package and Deployment Wizard makes it easy to package and distribute all of these files. For more information about the Access Run-Time, see Targeting the Access Run-Time.

Note   You may also be able to distribute other ActiveX controls, .exe files, and DLLs that you have purchased. Consult the manufacturer's license agreement for each of the files you plan to distribute to determine whether or not you have the right to distribute the file with your solution.

You can also use the packaging portion of the Package and Deployment Wizard to create dependency files. Dependency files list the run-time components that must be distributed with your solution's project files.

For More Information   For a more detailed explanation of standard packages and their contents, see in the "Distributing Your Applications" chapter of the Visual Basic Programmer's Guide. See in the "Distributing Your Applications" chapter of the Visual Basic Programmer's Guide for an explanation of the contents of a dependency file. For more information about deploying Office solutions, see Chapter 2, "" in the Microsoft Office 2000/Visual Basic Programmer's Guide.

The Packaging Process

These are the steps in the packaging process:

  • Determine the files you need to distribute.   The wizard must determine the project files and dependent files for your solution before it can create the package. Project files are the files included in the solution itself — for example, the .vbo file and its contents. Dependent files are run-time files or components your solution requires to run. Dependency information is stored in various .dep files corresponding to the components in your project.

  • If necessary, create dependency files for your solution's components.   If you determined in the previous step that your solution requires any dependency (.dep) files, you should create these files with the Package and Deployment Wizard prior to creating the package. You can then include these files as part of the package. For more information, see Creating Dependency Files.

  • Determine where to install files on the user's machine.   Program and setup files are usually installed into a subdirectory of the Program Files directory, while system and dependent files are usually installed into the \Windows\System or \Winnt\System32 directory. Your setup program must take this into account and determine where to install each file.

  • Create your package.   The wizard creates the package and the setup program (setup1.exe) for it, referencing all necessary files. The end result of this step is one or more .cab files and any necessary setup files.

To package your solution

  1. Access the Visual Basic Editor from the Office product in which you created the component.

  2. Launch the Package and Deployment Wizard from the Add-Ins menu.

    Tip   If you have not previously run the Package and Deployment Wizard, you may need to access the Add-Ins Manager to make it appear on the Add-Ins menu. Start the Add-Ins Manager, then select the Package and Deployment Wizard, and select the Loaded\Unloaded option. For more information, see Accessing Office 2000 Developer Tools.

  3. On the main screen of the wizard, click Package.

    Continue through the wizard until you have set the necessary options for your file, then click Finish.

    Note   If you are packaging a project from a third-party vendor, you may need to manually search for dependency files.

    For More Information   For a full list of common run-time, setup, and dependency files, see in the "Distributing Your Applications" chapter of the Visual Basic Programmer's Guide. See Creating Dependency Files later in this section for more information on creating a .dep file.