MathType Macro for OO

Issues with installing under all Linux Distributions

MathType Macro for OO

Postby thedoctor818 » Mon Aug 20, 2012 12:53 am

Hullo all. I am currently running Lubuntu 12.04, and using (though I had rather be using LaTeX-I have no choice in the matter-my new job requires MathType)MathType 6.8 I think. I was told that by inserting the following macro:

Code: Select all   Expand viewCollapse view
sub InsertMathTypeObject
rem ----------------------------------------------------------------------
rem define variables
dim obj as object
dim SName as string
dim oXEO as object
rem ----------------------------------------------------------------------
SName = "com.sun.star.text.TextEmbeddedObject"
obj = ThisComponent.createInstance(sName)
obj.CLSID = "0002CE03-0000-0000-C000-000000000046"
obj.attach(ThisComponent.currentController().Selec tion.getByIndex(0))
oXEO = obj.ExtendedControlOverEmbeddedObject
oXEO.doVerb(0)

end sub


I could then insert MT objects into OO. But so far, not only can I not go to Insert->Object->New->MT Object; but every time I try (copy and paste and manually typing it) to add the above macro, I get the following error:

BASIC runtime error.Object variable not set.

at the last line (oXEO.doVerb(0))

Pleas help. The only reason I 'ditched' LO and went 'back' to OO is that my local manager gave me the above code and said it was specifially for OO. If there is a similar macro for Lo, and I knew it would work, I would go back to that - but I am kind of stuck now, so any help is appreciated. Thanks.
Last edited by RoryOF on Mon Aug 20, 2012 6:34 am, edited 1 time in total.
Reason: Added [code] tags (RoryOF, Moderator)
-Michael Dykes
using Open Office 3.4 on Lubuntu 12.04
thedoctor818
 
Posts: 12
Joined: Mon Aug 20, 2012 12:52 am

Re: MathType Macro for OO

Postby FJCC » Mon Aug 20, 2012 2:33 am

I know nothing about MathType. I reproduced the error when running your code. Finding nothing wrong with it, as far as I could tell, I did a web search for CLSID MathType and found this. By changing the CLSID to the one found there, the code runs without error, brings up the Microsoft Equation Editor and whatever I type in that get embedded in my Writer document. Is that any help?
Code: Select all   Expand viewCollapse view
SName = "com.sun.star.text.TextEmbeddedObject"
obj = ThisComponent.createInstance(sName)
obj.CLSID = "00021700-0000-0000-C000-000000000046" 'Changed by FJCC
obj.attach(ThisComponent.currentController().Selection.getByIndex(0))
oXEO = obj.ExtendedControlOverEmbeddedObject
oXEO.doVerb(0)
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 7376
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: MathType Macro for OO

Postby thedoctor818 » Mon Aug 20, 2012 3:02 am

No unfortunately when I change the code I still get the mentioned error and the 'red arrow' (which I am guessing points to the incorrect lines of code?) is pointing to the last line, namely:

oXEO.doVerb(0)

Thanks again.
-Michael Dykes
using Open Office 3.4 on Lubuntu 12.04
thedoctor818
 
Posts: 12
Joined: Mon Aug 20, 2012 12:52 am

Re: MathType Macro for OO

Postby FJCC » Mon Aug 20, 2012 4:39 am

What I saw is that without a valid CLSID the obj has a VOID ExtendedControlEmbeddedObject. That results in oXEO not containing anything and when you try to use its doVerb() method, you get an error. The problem, however, is really at the assignment of the CLSID. Unfortunately, I don't know how to address that other than what I posted before.
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 7376
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: MathType Macro for OO

Postby hanya » Wed Aug 22, 2012 10:55 am

Wonder MathType works on Lubuntu?
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
hanya
Volunteer
 
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: MathType Macro for OO

Postby thedoctor818 » Wed Aug 22, 2012 12:58 pm

Yes, MathType works on Lubuntu via Wine-or are you asking if this macro will work in Lubuntu? I do not know, but i hope so. However until I can get this CLSID issue fixed (and I have searched the net quite a bit) I dunno what to do. This is kind of becoming urgent for me (and my job) that I resolve this soon. Thanks.
-Michael Dykes
using Open Office 3.4 on Lubuntu 12.04
thedoctor818
 
Posts: 12
Joined: Mon Aug 20, 2012 12:52 am

Re: MathType Macro for OO

Postby thedoctor818 » Sat Aug 25, 2012 6:52 pm

I am close to a solution here if I can just get some help. I ended up installing both MT and OO under WINE. Now the macros above works, but when I get back to OO, the equation I edited (or entered) in MT just appears as a blank box. What can I do next to solve this issue? Thanks.
-Michael Dykes
using Open Office 3.4 on Lubuntu 12.04
thedoctor818
 
Posts: 12
Joined: Mon Aug 20, 2012 12:52 am


Return to Linux

Who is online

Users browsing this forum: No registered users and 3 guests