Text Box Defaults Add-In Project for Microsoft Publisher

Click here 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.

 

Microsoft Corporation

July 2003

Applies to:
    Microsoft® Publisher 2002

Summary: Describes how to use the Text Box Defaults add-in project for Microsoft Publisher 2002 to enable users to extract the property settings from an existing text box to create new text boxes. Readers should be familiar with Microsoft Visual Basic 6.0. (3 printed pages)

Download DefTextBox.exe.

Contents

Introduction
Using the Project
How the Default Text Box Toolbar Works
Installing the Add-In
Using the Add-In

Introduction

The Text Box Defaults project is a Microsoft Visual Basic® 6.0 project that can be compiled into a Microsoft Publisher 2002 add-in toolbar. This toolbar allows the user to extract property settings from an existing text box and then create new text boxes with those settings.

Using the Project

The project consists of two Microsoft Visual Basic 6.0 files: DefTxtBx.dsr and DefTxtBx.vdp. Compile the project into a dynamic linking library (.dll) and then install it as an add-in for Publisher. Once installed, the Default Text Box toolbar is available in the Publisher application.

This add-in is presented as a Visual Basic project (rather than a compiled .dll) so you can build on and customize the code to suit your specific needs.

How the Default Text Box Toolbar Works

The Default Text Box toolbar consists of two buttons: the Set Text Box Defaults button, and the New Text Box Based on Defaults button.

The Set Text Box Defaults button does the following:

  • Extracts property settings from the selected text box
  • Creates a new text box in the corner of the scratch area
  • Applies the copied property settings to this scratch area text box for storage

The New Text Box Based on Defaults button does the following:

  • Creates a new text box with the property settings stored in the scratch area text box Each new text box is created in the upper left corner of the active page

Settings extracted and applied to new text boxes include properties of the following objects:

  • ColorFormat
  • FillFormat
  • Font
  • LineFormat
  • ShadowFormat
  • TextFrame
  • ThreeDFormat

Refer to the project code for the exact properties and settings that are extracted.

The following properties do not get extracted:

  • The InsetPen property of the LineFormat object
  • The Style property of the LineFormat object, if set to msoLineThickBetweenThin
  • The Type property of the FillFormat object, if set to msoFillPicture
  • The BorderArt property of the Shape object (this property is only present in Publisher 2003)

Installing the Add-In

To install the add-in once it has been compiled

  1. Open Microsoft Publisher.
  2. On the Tools menu, click Add-Ins.
  3. In the COM Add-Ins dialog box, click Add. Navigate to the location of the add-in, select it, and click OK. By default, Publisher looks in the following location: Document Settings/username/Application Data/Microsoft/Addins.
  4. Click OK.

Using the Add-In

To create a new text box using the Default Text Box toolbar

  1. Select the text box whose settings you want to copy.
  2. Click the Set Text Box Defaults button.
  3. Click the New Text Box Based on Defaults button. A new text box with the copied property settings is created in the upper left corner of the active page.