Does anyone have an example of using COM in OO? I found 1 link to tcom, but that is not part of OO or Star BASIC.
Thanks...
How to use COM in OO?
How to use COM in OO?
OOo 2.4.X on Ms Windows XP
-
- Volunteer
- Posts: 1160
- Joined: Mon Oct 08, 2007 1:26 am
- Location: France, Paris area
Re: How to use COM in OO?
Last edited by B Marcelly on Tue Feb 15, 2011 12:42 pm, edited 1 time in total.
Re: How to use COM in OO?
Thanks Bernard. I will have to spend some time on this. Apparently OO does not have a way of connecting to documents that are not exposed like VBA has. I have tried using DDE and whatever, but it has all failed. I am wondering if OO is going to correct this issue??? DDE is no longer supported by MS and it started failing years ago. I do some PLC work and a connection is required for data gathering. If OO doesn't do something, they are going to lose ground that they have gained.
I will get back in a few days.
I will get back in a few days.
OOo 2.4.X on Ms Windows XP
-
- Volunteer
- Posts: 1160
- Joined: Mon Oct 08, 2007 1:26 am
- Location: France, Paris area
Re: How to use COM in OO?
Hi,
If you mean load a document in hidden mode and handle it, of course that's possible with COM.
If you mean embedding OOo in a frame of another application, I have never succeeded in doing this. Perhaps others have.
I am not aware of any OOo development in the works to improve COM.
______
Bernard
I'm not sure to understand what you mean.grnhorn wrote:Apparently OO does not have a way of connecting to documents that are not exposed like VBA has.
If you mean load a document in hidden mode and handle it, of course that's possible with COM.
If you mean embedding OOo in a frame of another application, I have never succeeded in doing this. Perhaps others have.
I am not aware of any OOo development in the works to improve COM.
______
Bernard
Re: How to use COM in OO?
I meant to say that OO does not have a way to link to hidden documents using OO BASIC. OO apparently needs an interface like VBA to communicate with its own documents. What I am seeing, if I am correct, OO does not have any COM capabilities because it does not support object creation (Set OpenOffice = CreateObject("com.sun.star.ServiceManager"). I also assume that StarBasic does not support COM????
I am new at OO and have a long ways to go.
I am new at OO and have a long ways to go.
OOo 2.4.X on Ms Windows XP
Re: How to use COM in OO?
grnhorn,
I am also not completely sure what you are targeting at, but constructions like this work perfectly fine in OO Basic:
I am also not completely sure what you are targeting at, but constructions like this work perfectly fine in OO Basic:
Code: Select all
Sub Main
oleService = createUnoService("com.sun.star.bridge.OleObjectFactory")
oIE = oleService.createInstance("InternetExplorer.Application")
oIE.visible = true
oIE.Navigate("http://somehwhere/")
while oIE.Busy
wait(50)
wend
oDoc = oIE.Document
oInputs = oDoc.getElementsByTagName("INPUT")
oInputPass= oInputs.item(0)
msgbox "Now it will submit ..."
oInputPass.click
End Sub
Re: How to use COM in OO?
My actual target is sCalc in that I want to be able to manipulate the data in 1 sheet from 2 different sources while the target is not visible and accessible to the user.
I took a look at your example and I guess I am a little more confused by the following 2 examples:
I used xRay and 'getElementsByTagName' did not show up for oDoc and 'click' did not show up for 'oInputPass'. Where did you get these from? Also, I could not find a method for closing IE.
Thanks for your help...
I took a look at your example and I guess I am a little more confused by the following 2 examples:
Code: Select all
oInputs = oDoc.getElementsByTagName("INPUT")
oInputPass.click
Thanks for your help...
OOo 2.4.X on Ms Windows XP