OpenOffice Basic
Appearance

OpenOffice Basic (이전에 알려진 StarOffice Basic ,StarBasic 과 OOoBasic) 는 StarOffice와 office suite에서 유래되고 OpenOffice.org통해 퍼진 그리고 LibreOffice와 같은 파생물이다 ( LibreOffice Basic로 알려진). a dialect of the 프로그램 언어 BASIC
Example
오픈 오피스의 기본 자체는 다른 언어와 유사하지만, Microsoft의 VBA같은, 응용 프로그램 인터페이스 (API) 는 매우 다르다, macro의 예에서 보여주는것과 같이. "paragraph count" 문서를 얻을수 있는 더 쉬운 방법이 있지만, 이 예는 텍스트 문서 안에 있는 각 단락에 순차적으로 접근하기 위한 가장 기본적인 방법을 보여준다.
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
Further reading
- Steinberg, James. Open Office Basic: An Introduction. CreateSpace Independent Publishing Platform. ISBN 978-1481270939.
External links
BASIC Macros
- OpenOffice.org BASIC Programming Guide wiki
- OpenOffice.org VBA emulation model project (still in heavy development)
- Andrew Pitonyak's macro information