오픈오피스 베이직

위키백과, 우리 모두의 백과사전.

오픈오피스 베이직(OpenOffice Basic, 스타오피스베이직 혹은 스타오피스 or OOo베이직로 알려졌던) 은 프로그래밍 언어 베이직과 유사하다. 그 유래는 스타오피스 제품군을 통해 확산되었던 오픈오피스리브레오피스이다.

[편집]

매크로 일러스트레이터와 같은 예에 따르면 비록 오픈오피스 베이직이 베이직과 유사하지만 마이크로소프트VBA, API와는 매우 다르다.

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

같이 보기[편집]

더 보기[편집]

  • 슈타인버그, 제임스. 《오픈 오피스 베이직: 소개》. CreateSpace Independent Publishing Platform. ISBN 978-1481270939. 
베이직 매크로
오픈오피스 API
리브레오피스 API