Chapter 2 Customizing StarOffice on a Network
This chapter describes how to use custom macros, templates, and AutoText in
a network installation of StarOffice. The chapter also describes how to disable
the StarOffice registration wizard as well as how to configure StarOffice to work
with an email client.
Using Custom StarOffice Basic Macros and Libraries
StarOffice Basic is a programming language that you can use to automate tasks in StarOffice. StarOffice Basic macros
are stored in modules which in turn are stored in libraries. Libraries also act as
container for dialog boxes that you create in StarOffice Basic. You can store Basic libraries
in any directory that a user can access.
For information on how to create StarOffice Basic macros, see the StarOffice 8 Programming Guide for BASIC.
About StarOffice Basic Libraries and Modules
The default StarOffice Basic libraries are located in the <StarOffice installation>/share/basic directory. A library contains the following
files:
-
script.xlb
-
An XML file that contains the names of the modules in the library.
-
dialog.xlb
-
An XML file that contains the names OF dialog boxes in the library.
-
*.xba
-
An XML file that stores the StarOffice Basic source code for a single StarOffice Basic module.
The name of the file corresponds to the name of the module.
-
*.xdl
-
An XML file that stores the dialog elements of a StarOffice Basic dialog. The
name of the file corresponds to the name of the dialog.
-
*.pba
-
A StarOffice Basic module which is protected with a password, that is, the
source code is encrypted. The name of the file corresponds to the name of the module.
About StarOffice Basic Configuration Files
The script.xlc and dialog.xlc configuration
files list the location of StarOffice Basic libraries and dialogs. These files are in the <StarOffice installation>/user/basic/ directory which
also contains the default Standard StarOffice Basic library as well as the user-defined libraries.

Caution –
You cannot change the location of the script.xlc and dialog.xlc configuration files.
The XML-based script.xlc file includes a list of all Basic
libraries that are available to StarOffice. The following tags are used:
Example 2–1 Sample StarOffice Basic Configuration File
The following XML code is for a script.xlc configuration
file for StarOffice Basic libraries. The only difference between this file and a dialog.xlc file is that the xlink:href tag points to
the script.xlb file of a library instead of the dialog.xlb file.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library:libraries PUBLIC
"-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "libraries.dtd">
<library:libraries
xmlns:library="http://openoffice.org/2000/library"
xmlns:xlink="http://www.w3.org/1999/xlink">
<library:library library:name="Standard"
xlink:href="file:///.../user/basic/Standard/script.xlb/"
xlink:type="simple" library:link="false"/>
<library:library library:name="FormWizard"
xlink:href="file:///.../share/basic/FormWizard/script.xlb/"
xlink:type="simple" library:link="true" library:readonly="false"/>
</library:libraries>
-
library:name
-
Specifies the name of the StarOffice Basic library
-
xlink:href
-
Specifies the URL of the script.xlb file for
the library. The URL must begin with the file:/// notation.
Note –
You do not need to specify a value for the xlink:href tag
if the library is in the <user installation directory>/user/basic directory of the user installation.
-
xlink:type
-
This tag, which is required by the xlink:href tag,
must be set to simple.
-
library:link
-
Specifies that the entry is a link to a library that is not in the
default library location. The default location for StarOffice Basic libraries is <user installation directory>/user/basic. If you only
use the default location for the libraries, set the value of this tag to false. For all other libraries, set the value of this tag to true.
-
library:readonly
-
Specifies whether a library is read-only. Set the value of this tag
to true for read-only access.
Distributing StarOffice Basic Libraries
You can make custom StarOffice Basic libraries available to existing StarOffice installations
or new installations only.
To Make a Custom StarOffice Basic Library Available to All Users on
a Network
Before You Begin
Use StarOffice to create a custom library as well as the macros in the library.
Steps
-
As root, copy the custom library from the user installation where you
created the library to the StarOffice server installation.
cp -r <StarOffice user installation directory>/user/basic/custom library <StarOffice installation directory>/share/basic/
Note –
On Windows, the location of the custom library that you created is C:\Documents and Settings\user id\Application Data\StarOffice 8\user\basic\custom library.
-
In a text editor, open the script.xlc configuration
file for the user installation and add a link to the script.xlb configuration
file for the library.
Use the following syntax for the link:
<library:library library:name="Library Name"
xlink:href="$(USER)/basic/Library Name/script.xlb/"
xlink:type="simple" library:link="true" library:readonly="false"/>
-
On Solaris and Linux, open the <StarOffice user
installation directory>/user/basic/script.xlc configuration
file.
-
On Windows, open the C:\Documents and Settings\user id\Application Data\StarOffice 8\user\basic\script.xlc configuration file.
-
In a text editor, open the dialog.xlc configuration
file for the user installation and add a link to the script.xlb configuration
file for the library.
Use the following syntax for the link:
<library:library library:name="Library Name"
xlink:href="$(USER)/basic/Library Name/dialog.xlb/"
xlink:type="simple" library:link="false"/
-
On Solaris and Linux, open the <StarOffice user
installation directory>/user/basic/dialog.xlc configuration
file.
-
On Windows, open the C:\Documents and Settings\user id\Application Data\StarOffice 8\user\basic\dialog.xlc configuration file.
-
Restart StarOffice on the workstations.
To Make a Custom StarOffice Basic Library Available to a Single User
Steps
-
Copy the custom library from the user installation where you created the
library to the user installation where you want to deploy the library.
-
On Solaris and Linux, become root, and copy the library.
cp -r <StarOffice user installation directory>/user/basic/custom library <StarOffice user installation directory>/user/basic/
-
On Windows, become a user with administrator privileges, and copy the
library.
The file name path for the library is C:\Documents
and Settings\user id\Application Data\StarOffice 8\user\basic\custom library
-
In a text editor, open the script.xlc configuration
file for the user installation and add a link to the script.xlb configuration
file for the library.
Use the following syntax for the link:
<library:library library:name="Library Name"
xlink:href="$(USER)/basic/Library Name/script.xlb/"
xlink:type="simple" library:link="true" library:readonly="false"/>
-
On Solaris and Linux, open the <StarOffice user
installation directory>/user/basic/script.xlc configuration
file.
-
On Windows, open the C:\Documents and Settings\user id\Application Data\StarOffice 8\user\basic\script.xlc configuration file.
-
In a text editor, open the dialog.xlc configuration
file for the user installation and add a link to the script.xlb configuration
file for the library.
Use the following syntax for the link:
<library:library library:name="Library Name"
xlink:href="$(USER)/basic/Library Name/dialog.xlb/"
xlink:type="simple" library:link="false"/
-
On Solaris and Linux, open the <StarOffice user
installation directory>/user/basic/dialog.xlc configuration
file.
-
On Windows, open the C:\Documents and Settings\user id\Application Data\StarOffice 8\user\basic\dialog.xlc configuration file.
-
Restart StarOffice.
To Install a Custom StarOffice Basic Library With a Macro
You can create a macros that installs a StarOffice Basic library from a StarOffice document.
Steps
-
In Writer, create a custom StarOffice Basic library
in a new document.
-
Save the document.
-
Create an installation macro.
-
Choose Tools - Macros - Organize Macros - StarOffice Basic.
The StarOffice Basic Macros dialog box opens.
-
In the Macro from list, select your Writer document.
-
In the Macro name box, enter a name from the installation
macro.
-
Click the New button.
The BASIC IDE window opens.
-
Enter the following code:
Sub AddBasicLibrary
Dim SourceLibraryName As String, DestLibraryName As String
Dim oSrcLib As Object, oDestLib As Object, iCounter As Integer
Dim oLib As Object, oGlobalLib As Object
' set these 2 variables to your lib name
SrcLibraryName = "TextLib"
' The name of the library that contains the modules
DestLibraryName = "NewLib"
' This library will be created and is the
' destination for the modules from the source document.
oLib = BasicLibraries ' For Basic libaries
oGlobalLib = GlobalScope.BasicLibraries
For iLib = 1 To 2
If oGlobalLib.hasByName( DestLibraryName ) = False Then
oGlobalLib.createLibrary( DestLibraryName )
End If
If oLib.hasByName( SrcLibraryName ) Then
oLib.loadLibrary( SrcLibraryName )
oSrcLib = oLib.getByName( SrcLibraryName )
sSrcModules = oSrcLib.getElementNames()
iCounter = lBound( sSrcModules() )
while( iCounter <= uBound( sSrcModules() ) )
oDestLib = oGlobalLib.getByName(DestLibraryName)
If oDestLib.hasByName( sSrcModules(iCounter) ) = False
Then
oDestLib.insertByName( sSrcModules(iCounter),
_ oSrcLib.getByName( sSrcModules(iCounter) ) )
End If
iCounter = iCounter + 1
wend
End If
oLib = DialogLibraries ' The same for the Dialog libraries
oGlobalLib = GlobalScope.DialogLibraries
Next iLib
End Sub
-
Replace the SrcLibraryName and DestLibraryName variables with the name of your library.
-
Close the BASIC IDE window.
-
Add a push button to the document.
-
On the Tools toolbar, open the Controls toolbar, and click the Push Button icon.
-
In your document, drag to draw the button.
-
Assign the installation macro to a button event.
-
Right-click the button, and choose Control.
-
Click the Events tab.
-
Click the ... next to a button event, for example,
the Mouse button pressed event.
-
In the Assign Macro dialog box, click the Assign button.
The Macro Selector dialog
box opens.
-
In the Library list, select the library that contains
the installation macro.
-
In the Macro name list, select the installation macro.
-
Click the OK button.
-
In the Assign Macro dialog box, click the OK button.
-
Save the document.
Using the StarOffice Package Manager
You can use the StarOffice Package Manager to add, to remove, to disable,
to enable, and to export StarOffice packages. For example, you can use the Package
Manager to add or to remove the following types of packages:
-
StarOffice Basic libraries
-
StarOffice dialog libraries
-
Universal Network Objects (UNO) components
These components
represent compiled software packages. UNO is the interface-based component model for StarOffice.
For more information on this model, go to the UNO Development Kit project web site
at: http://udk.openoffice.org.
-
Menu configuration data
-
Package bundles
A package bundle is a *.zip archive file that contains one of more packages.
Note –
You cannot manage XSLT filters, language modules, or palettes with the
Package Manager.
You can manage packages from a dialog box or a command-line.
Using the Package Manager Dialog Box
You can open the Package Manager dialog box from the Tools menu
in any StarOffice Program. However, to add packages for all users of a StarOffice installation,
you need to open the Package Manager dialog box from the command-line.
To Add a Package With the Package Manager Dialog Box
Steps
-
Become root.
-
In UNIX and Linux, open a terminal, and type su.
-
In Windows, open a Command Prompt.
-
Change to the <StarOffice installation directory>/Staroffice8/program directory.
-
Type unopkg gui.
The Package Manager dialog
box opens.
-
In the list of packages, select the package category that you want to
add the package to.
-
Click the Add button.
-
Locate the package that you want to add, and then click the Open button.
To Remove a Package With the Package Manager Dialog Box
Steps
-
Become root.
-
In UNIX and Linux, open a terminal, and type su.
-
In Windows, open a Command Prompt.
-
Change to the <StarOffice installation directory>/Staroffice8/program directory.
-
Type unopkg gui.
The Package Manager dialog
box opens.
-
In the list of packages, select the package that you want to remove.
-
Click the Remove button.
Using the unopkg Command to Manage Packages
You can manage packages from the command line. The syntax for the unopkg command is as follows:
unopkg add {v, f, log-file, shared} package-path |
remove {v, f, log-file, shared} package-name | list {v,
f, log-file, shared} package-name | reinstall {v, f, log-file,
shared} | gui | -V | -h
-
add
-
Adds packages to a StarOffice installation.
-
remove
-
Removes packages from a StarOffice installation.
-
list
-
Displays information about the deployed packages.
-
reinstall
-
Reinstalls the deployed packages.
-
gui
-
Opens the Package Manager dialog box.
-
–V, – –version
-
Displays the version information for the unopkg command.
-
–h, – –help
-
Displays the help for the unopkg command.
-
-v, --verbose
-
Runs the command in verbose mode.
-
-f, --force
-
Overwrites existing packages that have the same names.
-
--log-file <filename>
-
Creates a log file. The default file name path for the log file is <cache-dir>/log.txt.
-
--shared
-
Expert feature: operate on shared installation deployment context;
run only when no concurrent processes are running
Adding Template Files to a StarOffice Installation
You can make custom document templates to all or to individual users of a network
installation of StarOffice network installation. You can also make specific directories
for document templates available to these users.

Caution –
Do not give users write permission for template files.
To Add a Template For All Users of a StarOffice Network
Installation
Steps
-
Become root.
-
Copy the template to the <StarOffice network installation directory>/share/template/ directory.
To Add a Template to a Workstation Installation of StarOffice
Steps
-
Become root.
-
Copy the template to the <StarOffice installation>/user/template/ directory on the workstation.
To Add a Template Directory to a StarOffice Installation
Steps
-
In any StarOffice program, choose Tools – Options – StarOffice – Paths.
-
In the list of default paths, select “Templates”, and then
click the Edit button.
-
In the Select Paths dialog box, click the Add button.
-
Locate the template directory that you want to add and click the OK button.
-
In the Select Paths dialog box, click the OK button.
-
In the Options – StarOffice – Paths dialog
box, click the OK button.
-
Exit StarOffice.
StarOffice saves the template path to
the user installation directory/staroffice8/user/registry/data/org/openoffice/Office/Common.xcu configuration file.
-
Copy the following code into the appropriate Common.xcu file.
<node oor:name="Path">
<node oor:name="Current">
<prop oor:name="Template" oor:type="oor:string-list">
<value>$(inst)/share/template/$(vlang)
$(user)/template new_template_directory
</value>
</prop>
</node>
</node>
-
To make the template directory available to all users of the StarOffice network
installation, copy the code into the StarOffice installation directory/share/registry/data/org/openoffice/Office/Common.xcu file.
-
To make the template directory available to a single user of a StarOffice network
installation, copy the code into the user installation directory/user/registry/data/org/openoffice/Office/Common.xcu file.
Adding AutoText Files to a StarOffice Network Installation
StarOffice saves AutoText entries to categories in *.bau files.
You can make custom AutoText files available to all or to individual users of a network
installation of StarOffice network installation.
Note –
For information on how to create AutoText entries, search for the keyword
"AutoText" in the online help for StarOffice Writer.
To Add a AutoText Files For All Users Of a StarOffice Network
Installation
Steps
-
Become root.
-
Copy the AutoText *.bau file to the <StarOffice network installation directory>/share/autotext/ directory.
To Add AutoText Files to a Workstation Installation of StarOffice
Steps
-
Become root.
-
Copy the AutoText *.bau file to the <StarOffice installation>/user/autotext/ directory on
the workstation.
To Add an AutoText Directory to a StarOffice Installation
Steps
-
In any StarOffice program, choose Tools – Options – StarOffice – Paths.
-
In the list of default paths, select “AutoText”, and then
click the Edit button.
-
In the Select Paths dialog box, click the Add button.
-
Locate the directory that contains the AutoText *.bau files
that you want to add and click the OK button.
-
In the Select Paths dialog box, click the OK button.
-
In the Options – StarOffice – Paths dialog
box, click the OK button.
-
Exit StarOffice.
StarOffice saves the AutoText path to
the user installation directory/StarOffice8/user/registry/data/org/openoffice/Office/Common.xcu configuration file.
-
Copy the following code into the appropriate Common.xcu file.
<node oor:name="Path">
<node oor:name="Current">
<prop oor:name="AutoText" oor:type="oor:string-list">
<value>$(inst)/share/autotext/$(vlang)
$(user)/autotext new_autotext_directory
</value>
</prop>
</node>
</node>
-
To make the AutoText directory available to all users of the StarOffice network
installation, copy the code into the StarOffice installation directory/share/registry/data/org/openoffice/Office/Common.xcu file.
-
To make the AutoText directory available to a single user of a StarOffice network
installation, copy the code into the user installation directory/user/registry/data/org/openoffice/Office/Common.xcu file.
Deactivating the StarOffice Registration Wizard
The first time that you start StarOffice, a wizard opens to guide you through
the registration process. You can also start this process if you choose the Help – Registration menu item in any StarOffice program.
If you want, you can use a configuration file to deactivate the registration wizard
as well as the Registration menu command.
To Deactivate the Registration Wizard at the First Startup
of StarOffice
Before You Begin
You can only perform this task during the first start up of StarOffice after
you install StarOffice.
Steps
-
Start StarOffice.
The Registration Wizard opens.
-
Follow the instructions.
-
On the step 3 User Name page, leave the user information
boxes empty.
-
On the step 4 Registration page, select I do not want to register, and then click the Finish button.
-
Create an archive file of the StarOffice 8 user directory.
-
On Windows XP, create a ZIP file of the C:\Documents and Settings\username\Application Data\StarOffice 8 directory.
-
On UNIX and Linux, create a TAR file of the home/.staroffice8 directory.
-
Unpack the archive into the user directories where you want to deactivate
the Registration Wizard.
-
On Windows XP, unpack the contents of the archive to C:\Documents
and Settings\username\Application Data\StarOffice 8
-
On UNIX and Linux, unpack the contents of the archive to home/.staroffice8 directory.
Accessing Email Clients
In StarOffice, you can send the current document as an email attachment.
In Solaris and Linux, the email client must support the attachment of a document
to an email message through a command-line. In Windows, the email client must support
the Messaging Application Program Interface (MAPI).
StarOffice officially supports the following email clients on Solaris, Linux,
and Windows:
-
Mozilla 1.4 and higher
-
Netscape 7.1 and higher
Configuring StarOffice to Use an Email Client on Solaris
and Linux
You need to specify the email client that you want to use in the StarOffice Tools menu.
To Specify the Email Client to Use With StarOffice in Solaris
and Linux
Steps
-
In StarOffice Writer, choose Tools – Options – Internet – E-mail.
-
Click the ... next to the E-mail program box.
-
Locate the email client that you want to use and click the Open button.
Configuring StarOffice to Use an Email Client on Windows
You do not need to configure StarOffice to use an email client in Windows. StarOffice automatically
uses the default email client, so long as the client uses the Messaging Application
Program Interface (MAPI).
Note –
StarOffice uses the senddoc.exe program in the program directory of the StarOffice installation to access the MAPI email
client.