Solved

OpenOffice macro capability

Posted on 2013-12-11
2
427 Views
Last Modified: 2013-12-15
I'm contemplating using Open Office for a particular purpose that would require macros, so I have some basic questions (hoping to shorten the research time), starting with:

Can a Basic macro in a spreadsheet access and control shapes in a drawing?  (This is something that can be done in MS Office VBA.)   And if so, where might I start to learn about that?

Any pointers on this would be appreciated.

Thanks!
0
Comment
Question by:codequest
2 Comments
 
LVL 21

Accepted Solution

by:
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 500 total points
ID: 39713225
Without knowing more detials it is hard to say it will do the same as MS Office.

Yes you can draw shapes in Calc


Install MRI and learn about the concept of services and interfaces

The spreadsheet document supports several services to create new instances of various shape types.

    AvailableServiceNames in MRI wrote:com.sun.star.drawing.AppletShape
    com.sun.star.drawing.BitmapTable
    com.sun.star.drawing.CaptionShape
    com.sun.star.drawing.ClosedBezierShape
    com.sun.star.drawing.ClosedFreeHandShape
    com.sun.star.drawing.ConnectorShape
    com.sun.star.drawing.ControlShape
    com.sun.star.drawing.CustomShape
    com.sun.star.drawing.DashTable
    [ and more ]

Open in new window


Each sheet has one draw page.
To the the draw page you can add shapes.

Code snippet recorded while browsing MRI:
    Sub Snippet( oInitialTarget )
      Dim oSheets As Object
      Dim oObj1 As Object
      Dim oDrawPage As Object

      oSheets = oInitialTarget.Sheets
     
      oObj1 = oSheets.getByName( "Sheet1" )
      oDrawPage = oObj1.getDrawPage()
    End Sub

Open in new window





Here are some pointers as requested:

OpenOffice.org BASIC Programming Guide
https://wiki.openoffice.org/wiki/Documentation/BASIC_Guide

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

Calc Examples
Spreadsheet  code examples

Andrew Pitonyak's OpenOffice Macro Information
0
 
LVL 2

Author Closing Comment

by:codequest
ID: 39720389
helpful tips and links
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Outline Suppose you have some simple text based data in Excel that you would like to display as a PowerPoint presentation. Of course it would be possible to write some fairly complex VBA code that created a new slide for each line of the Excel data…
With the internet and the ease of information transference, many professional jobs can be done anywhere today.  Why should it make a difference whether an x-ray is read in India or the United States as long as the radiologist is qualified?   Outso…
This video teaches the viewer how to align pictures around text while keeping the text properly aligned in the document.
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now