StarOffice 8 Programming Guide for BASIC
  Rechercher uniquement dans ce livre
Télécharger cet ouvrage au format PDF (1223 Ko)

Chapter 1 Introduction

This guide provides an introduction to programming with StarOfficeTM 8 Basic and indicates the possible applications provided by using StarOffice Basic in StarOffice. To get the most out of this book, you should be familiar with other programming languages.

Extensive examples are provided to help you quickly develop your own StarOffice Basic programs.

How This Book Is Organized

The first three chapters introduce readers to StarOffice Basic:

These chapters provide an overview of StarOffice Basic and should be read by anyone who intends to write StarOffice Basic programs.

The remaining chapters describe the individual components of the StarOffice API in more detail and can be read selectively as required:

About StarOffice Basic

The StarOffice Basic programming language has been developed especially for StarOffice and is firmly integrated in the Office package.

As the name suggests, StarOffice Basic is a programming language from the Basic family. Anyone who has previously worked with other Basic languages — in particular with Visual Basic or Visual Basic for Applications (VBA) from Microsoft — will quickly become accustomed to StarOffice Basic. Large sections of the basic constructs of StarOffice Basic are compatible with Visual Basic.

The StarOffice Basic programming language can be divided into four components:

  • The language of StarOffice Basic: Defines the elementary linguistic constructs, for example, for variable declarations, loops, and functions.

  • The runtime library: Provides standard functions which have no direct reference to StarOffice, for example, functions for editing numbers, strings, date values, and files.

  • The StarOffice API (Application Programming Interface): Permits access to StarOffice documents and allows these to be created, saved, modified, and printed.

  • The Dialog Editor: Creates personal dialog windows and provides scope for the adding of control elements and event handlers.


Note –

Compatibility between StarOffice Basic and VBA relates to the StarOffice Basic language as well as the runtime library. The StarOffice API and the Dialog Editor are not compatible with VBA (standardizing these interfaces would have made many of the concepts provided in StarOffice impossible).


Intended Users of StarOffice Basic

The scope of application for StarOffice Basic begins where the standard functions of StarOffice end. Routine tasks can therefore be automated in StarOffice Basic, links can be made to other programs — for example to a database server — and complex activities can be performed at the press of a button by using predefined scripts.

StarOffice Basic offers complete access to all StarOffice functions, supports all functions, modifies document types, and provides options for creating personal dialog windows.

Use of StarOffice Basic

StarOffice Basic can be used by any StarOffice user without any additional programs or aids. Even in the standard installation, StarOffice Basic has all the components needed to create its own Basic macros, including:

  • The integrated development environment (IDE) which provides an editor for creating and testing macros.

  • The interpreter, which is needed to run StarOffice Basic macros.

  • The interfaces to various StarOffice applications, which allow for direct access to Office documents.

More Information

The components of the StarOffice API that are discussed in this guide were selected based on their practical benefits for the StarOffice Basic programmer. In general, only parts of the interfaces are discussed. For a more detailed picture, see the API reference which is available on the Internet at:

http://api.openoffice.org/docs/common/ref/com/sun/star/module-ix.html

The Developer's Guide describes the StarOffice API in more detail than this guide, but is primarily intended for Java and C++ programmers. Anyone who is already familiar with StarOffice Basic programming can find additional information in the Developer's Guide on StarOffice Basic and StarOffice programming. You can download the Developer's Guide on the Internet from:

http://api.openoffice.org/DevelopersGuide/DevelopersGuide.html

Programmers who want to work directly with Java or C++ rather than StarOffice Basic should consult the StarOffice Developer's Guide instead of this guide. StarOffice programming with Java or C++ is a considerably more complex process than programming with StarOffice Basic.