Solved

OpenOffice macro capability

Posted on 2013-12-11
2
462 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

Save the day with this special offer from ATEN!

Save 30% on the CV211 using promo code EXPERTS30 now through April 30th. The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
The advancement in technology has been a great source of betterment and empowerment for the human race, Nevertheless, this is not to say that technology doesn’t have any problems. We are bombarded with constant distractions, whether as an overload o…
This video walks the viewer through the process of creating an MLA formatted document, as well as a bibliography with citations.
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.

730 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