Sign in to follow this  
Followers 0
LOULOU

OPEN OFFICE

21 posts in this topic

Has anyone trying to use an open office object and haviong code for dealing with this object ?

Thanks

Share this post


Link to post
Share on other sites



wat do u mean wen u say "open office"???


[font="Fixedsys"][size="3"][u][font="Franklin Gothic Medium"] [/font][/u][/size][/font]

Share this post


Link to post
Share on other sites

Excellent Program!! I havent used it with AutoIt.


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

Has anyone trying to use an open office object and haviong code for dealing with this object ?

Thanks

"object"? Are you suggesting that OOo has a COM interface? Being cross-platform I didn't expect that to ever be the case... if you know differently, please provide a pointer to more information.

Thanks,

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

I used Open Office but there isn't quite as much documentation as Excel, Word, etc. I would suggest using microsoft products until you know the basic interface, because OOo probably has the same configuration with less relaiblity. I am not sure, just an idea.

Share this post


Link to post
Share on other sites

I used Open Office but there isn't quite as much documentation as Excel, Word, etc. I would suggest using microsoft products until you know the basic interface, because OOo probably has the same configuration with less relaiblity. I am not sure, just an idea.

Let me make sure I understand you correctly. You're saying use software that costs a few hundred dollars, get used to it, then migrate to free software which is going to be similar but probably not 100% identical. So you're suggesting to throw away both time and money? Did I miss the sign at the door that said "Welcome to Backwards Land"?

Share this post


Link to post
Share on other sites

Hello LOULOU,

You can use OOffice and the Beta version of AutoIt (with the COM support).

Here is a not perfect first example to show you how to launch OO.

Dim $MyArg

$oSM= ObjCreate("com.sun.star.ServiceManager")
if IsObj( $oSM ) Then
    $oDSK= $oSM.createInstance("com.sun.star.frame.Desktop")
    if IsObj($oDSK) Then
    Else
        MsgBox(0," Not Connected"," $oDSK ")
        Exit
    EndIf
Else
    MsgBox(0," Not Connected"," $oSM ")
    Exit
EndIf
$oDOC= $oDSK.loadComponentFromURL("private:factory/swriter","_blank", 0 , $MyArg)

I still have a problem with the last line and I suppose that it is with the last parameter.

C:\Documents and Settings\Administrateur\Bureau\Autoit\dc.au3 (16) : ==> The requested action with this object has failed.:

$oDOC= $oDSK.loadComponentFromURL("private:factory/swriter","_blank", 0 , $MyArg)

$oDOC= $oDSK.loadComponentFromURL("private:factory/swriter","_blank", 0 , $MyArg)^ ERROR

The OO Api documentation explains how to use this Method and I have tried a few solutions but nothing works.

Any help would make my day better,

Francis

Share this post


Link to post
Share on other sites

Hello LOULOU,

You can use OOffice and the Beta version of AutoIt (with the COM support).

Here is a not perfect first example to show you how to launch OO.

Dim $MyArg

$oSM= ObjCreate("com.sun.star.ServiceManager")
if IsObj( $oSM ) Then
    $oDSK= $oSM.createInstance("com.sun.star.frame.Desktop")
    if IsObj($oDSK) Then
    Else
        MsgBox(0," Not Connected"," $oDSK ")
        Exit
    EndIf
Else
    MsgBox(0," Not Connected"," $oSM ")
    Exit
EndIf
$oDOC= $oDSK.loadComponentFromURL("private:factory/swriter","_blank", 0 , $MyArg)

I still have a problem with the last line and I suppose that it is with the last parameter.

C:\Documents and Settings\Administrateur\Bureau\Autoit\dc.au3 (16) : ==> The requested action with this object has failed.:

$oDOC= $oDSK.loadComponentFromURL("private:factory/swriter","_blank", 0 , $MyArg)

$oDOC= $oDSK.loadComponentFromURL("private:factory/swriter","_blank", 0 , $MyArg)^ ERROR

The OO Api documentation explains how to use this Method and I have tried a few solutions but nothing works.

Any help would make my day better,

Francis

Hello Francis,

Thanks to respond me. I have the same problem at the same line. I propose to create a thread on Open Office. In fact my problem is the following, I want to write a program which uses Microsoft excel and macros and i find a free way to port mu program with autoit.

What Do you think about opening a new thread ?

Share this post


Link to post
Share on other sites

It could be a good thing. I really wants to have the solution for our (common now) problem.I often use AutoIt in COM solutions and I would like to understand why we have this "The requested action with this object has failed.:"

Regards,

Francis

Share this post


Link to post
Share on other sites

It could be a good thing. I really wants to have the solution for our (common now) problem.I often use AutoIt in COM solutions and I would like to understand why we have this "The requested action with this object has failed.:"

Regards,

Francis

I find the solution. Try this code it walks. It's open a new doc in a new windows

Dim $OpenPar[3]
Global $setOOoProp


;Instancie OOo : ces deux lignes sont obligatoires avec VB dans tout code !
  $oSM = Objcreate("com.sun.star.ServiceManager")
  $oDesk = $oSM.createInstance("com.sun.star.frame.Desktop")

;On appelle la fonction setOOoProp définie précédemment pour récupérer la structure
   $OpenPar[0]= setProp("ReadOnly", True)
   $OpenPar[1] = setProp("Password", "secret")
    $OpenPar[2] = setProp("Hidden", False)
 

;On appelle la fonction OOo loadComponentFromURL, en lui passant en
   $r_doc = $oDesk.loadComponentFromURL( "private:factory/swriter", "_blank", 0, $OpenPar)

Exit 

Func setProp($cName, $uValue) 
    
; Dim $oPropertyValue 
; Dim $oSM 
    
  $oSM = Objcreate("com.sun.star.ServiceManager")   
  $oPropertyValue = $oSM.Bridge_GetStruct("com.sun.star.beans.PropertyValue")
  $oPropertyValue.Name = $cName
  $oPropertyValue.Value = $uValue
      
  $setOOoProp= $oPropertyValue
  Return $setOOoProp
EndFunc

Share this post


Link to post
Share on other sites

Well done. This Sunday seems to be better now.

Regards,

Francis

Share this post


Link to post
Share on other sites

@Valik, free editions of those pieces of software are avialible, along with pirate copies from torrent networks, from friends with disks. The chances are that someone they know has it or they can get it for free. So don't freak out. Microsoft has there software well documented and it would be a good way for the user to learn Obj/COM interface so they could productivly work on OOo, please don't slam me for suggestions and ideas Valik.

Share this post


Link to post
Share on other sites

Microsoft doesn't document well, they just document more than most others. There are still large gaps. Microsoft is also prone to odd, unintuitive designs. I wouldn't really consider any Microsoft product a good learner tool unless you want to learn with the hard stuff first.

Share this post


Link to post
Share on other sites

I was just saying getting used to the Obj/COM interface of AutoIt could be used in examples with excel and word especially since there are so many examples on this forum with excel and other programs etc.

Share this post


Link to post
Share on other sites

Many thanks to LOULOU for startin to think and to implement for this fantastic free software.

I'm trying to attach to existing com.sun.star.ServiceManager object and unsuccesfully :P.

Why creation of the object is possible and attaching is not?

if OpenOffice Calc is runnin $o_Result = ObjGet("", "com.sun.star.ServiceManager") returns 0.

May be UNO – Universal Network Objects – aren't com-objects.

There is UNO-OLE Bridge, but I'm not so tough to get what is this about. Does someone have an idea?

Share this post


Link to post
Share on other sites

Point is that there is vbs-script which easy to convert to au3 for attaching to already opened in memory Open Office calc document.

Currently i'm workin on OOoCOM_UDF.au3 library. I have already done _OOoCalc_Open() and _OOoCalc_Attach funcs.

Share this post


Link to post
Share on other sites

Point is that there is vbs-script which easy to convert to au3 for attaching to already opened in memory Open Office calc document.

Currently i'm workin on OOoCOM_UDF.au3 library. I have already done _OOoCalc_Open() and _OOoCalc_Attach funcs.

Excellent. Hope to see your UDF in the Example Scipts section when you get your first version ready.

:P


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0