HOME

TheInfoList



OR:

OpenOffice Basic (formerly known as StarOffice Basic or StarBasic or OOoBasic) is a dialect of the
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming l ...
BASIC BASIC (Beginners' All-purpose Symbolic Instruction Code) is a family of general-purpose, high-level programming languages designed for ease of use. The original version was created by John G. Kemeny and Thomas E. Kurtz at Dartmouth College ...
that originated with the
StarOffice StarOffice is a discontinued proprietary office suite, intended to compete with the marketing-leading Microsoft Office. It served as the basis for open-source suites OpenOffice.org and LibreOffice. StarOffice supported the OpenOffice.org XML fi ...
office suite Productivity software (also called personal productivity software or office productivity software) is application software used for producing information (such as documents, presentations, worksheets, databases, charts, graphs, digital painting ...
and spread through OpenOffice.org and derivatives such as
Apache OpenOffice Apache OpenOffice (AOO) is an open-source office productivity software suite. It is one of the successor projects of OpenOffice.org and the designated successor of IBM Lotus Symphony. It is a close cousin of LibreOffice, Collabora Online an ...
and
LibreOffice LibreOffice () is a free and open-source office productivity software suite, a project of The Document Foundation (TDF). It was forked in 2010 from OpenOffice.org, an open-sourced version of the earlier StarOffice. The LibreOffice suite consi ...
(where it is known as LibreOffice Basic). The language is a domain-specific programming language which specifically serves the OpenOffice application suite.


Example

Although OpenOffice Basic is similar to other dialects of BASIC, such as
Microsoft Microsoft Corporation is an American multinational corporation, multinational technology company, technology corporation producing Software, computer software, consumer electronics, personal computers, and related services headquartered at th ...
's
Visual Basic for Applications Visual Basic for Applications (VBA) is an implementation of Microsoft's event-driven programming language Visual Basic 6.0 built into most desktop Microsoft Office applications. Although based on pre-.NET Visual Basic, which is no longer supporte ...
(VBA), the application programming interface (API) is very different, as the example below of a
macro Macro (or MACRO) may refer to: Science and technology * Macroscopic, subjects visible to the eye * Macro photography, a type of close-up photography * Image macro, a picture with text superimposed * Monopole, Astrophysics and Cosmic Ray Observat ...
illustrates. While there is a much easier way to obtain the "paragraph count" document property, the example shows the fundamental methods for accessing each paragraph in a text document, sequentially. Sub ParaCount ' ' Count number of paragraphs in a text document ' Dim Doc As Object, Enum As Object, TextEl As Object, Count As Long Doc = ThisComponent ' Is this a text document? If Not Doc.SupportsService("com.sun.star.text.TextDocument") Then MsgBox "This macro must be run from a text document", 64, "Error" Exit Sub End If Count = 0 ' Examine each component - paragraph or table? Enum = Doc.Text.CreateEnumeration While Enum.HasMoreElements TextEl = Enum.NextElement ' Is the component a paragraph? If TextEl.SupportsService("com.sun.star.text.Paragraph") Then Count = Count + 1 End If Wend 'Display result MsgBox Count, 0, "Paragraph Count" End Sub


See also

*
Comparison of office suites The following tables compare general and technical information for a number of office suites: General information Office Suite names that are on a light purple background are discontinued. OS support The operating systems the office suites ...


Further reading

*


External links


OpenOffice.org BASIC Programming Guide
wiki
LibreOffice Basic HelpAutomating Open Office in VB.NET
{{BASIC Articles with example BASIC code BASIC programming language family
Basic BASIC (Beginners' All-purpose Symbolic Instruction Code) is a family of general-purpose, high-level programming languages designed for ease of use. The original version was created by John G. Kemeny and Thomas E. Kurtz at Dartmouth College ...
Basic BASIC (Beginners' All-purpose Symbolic Instruction Code) is a family of general-purpose, high-level programming languages designed for ease of use. The original version was created by John G. Kemeny and Thomas E. Kurtz at Dartmouth College ...