{"id":1094,"date":"2009-09-22T19:13:47","date_gmt":"2009-09-23T01:13:47","guid":{"rendered":"http:\/\/bililite.nfshost.com\/blog\/?p=1094"},"modified":"2009-09-22T19:13:47","modified_gmt":"2009-09-23T01:13:47","slug":"openoffice-org-quirks","status":"publish","type":"post","link":"https:\/\/bililite.com\/blog\/2009\/09\/22\/openoffice-org-quirks\/","title":{"rendered":"OpenOffice.org quirks"},"content":{"rendered":"<p>Some of the first things I needed to get straight to move from Microsoft Office scripting to Open Office scripting:<\/p>\r\n<ul>\r\n<li>The BASIC isn't quite compatible: I know the object model is completely different, but even the underlying language isn't quite the same. I wanted to use the <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/t2ekk41a%28VS.80%29.aspx\"><code>InStrRev<\/code><\/a> function, but it wasn't there! Then I found <code>option VBASupport 1<\/code> which puts it in. It's (as far as I can tell) undocumented but mentioned all over on the web. I'm not sure what else it changes (again, in the language, not the object model).<\/li>\r\n<li>The name of the program is OpenOffice.org; evidently Open Office is trademarked by someone else. I'll do my best to comply.<\/li>\r\n<li>Sizes are in hundredths of a millimeter (<a href=\"http:\/\/www.unc.edu\/~rowlett\/units\/prefixes.html\">dekamicrons<\/a>? abbreviated as da&micro;; I can't find anyone using a better abbreviation), so my code has a lot of <code>x = y * 2540\/72<\/code>: 2540 mm per inch, 72 points per inch.<\/li>\r\n<li>Inserting control elements is more complicated than I would have thought; the object model divides them into \"model\" and \"view\" and figuring out which properties belong to which takes some searching and experimenting:\r\n<pre><code class=\"language-vb\">\tDim rng as com.sun.star.text.TextRange, checkModel, checkbox\r\n\tcheckModel = doc.createInstance(\"com.sun.star.form.component.CheckBox\")\r\n\tcheckView = doc.createInstance(\"com.sun.star.drawing.ControlShape\")\r\n\tcheckView.control = checkModel\r\n\trng.Text.insertTextContent(rng, checkView, True)\r\n<\/code><\/pre><\/li>\r\n<\/ul>","protected":false},"excerpt":{"rendered":"Some of the first things I needed to get straight to move from Microsoft Office scripting to Open Office scripting: The BASIC isn't quite compatible: I know the object model is completely different, but even the underlying language isn't quite the same. I wanted to use the InStrRev function, but it wasn't there! Then I [&hellip;]","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"_links":{"self":[{"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/posts\/1094"}],"collection":[{"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/comments?post=1094"}],"version-history":[{"count":8,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/posts\/1094\/revisions"}],"predecessor-version":[{"id":1102,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/posts\/1094\/revisions\/1102"}],"wp:attachment":[{"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/media?parent=1094"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/categories?post=1094"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/tags?post=1094"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}