Importing .OCX controls in vbscript

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
ScreamingCactus
Posts: 1
Joined: Wed Aug 27, 2008 9:00 pm

Importing .OCX controls in vbscript

Post by ScreamingCactus »

Hi, I'm trying to access COM ports via macros in OOo. The easiest way, in Excel, seems to be to import the MSComm32.OCX control and use it to talk to the ports. However, I can't figure out how to import the control in OOo. I looked thru the help but it seemed somewhat vague on the subject. Normally I just go to Project-->Components and add the .OCX, but I can't find the dialog in OOo where you add it. Is it possible to import OCX controls into Openoffice?
OOo 2.3.X on MS Windows Vista + SuSE 10.2
ms777
Volunteer
Posts: 177
Joined: Mon Oct 08, 2007 1:33 am

Re: Importing .OCX controls in vbscript

Post by ms777 »

Hi,

I am afraid it is not that simple in OO. They only way I can imagine to access the com ports is using the kernel32.dll functions. See e.g. http://support.microsoft.com/kb/823179/en-us (the part starting with "Use platform invoke services to call Win32 API functions in Visual Basic .NET to access serial and parallel ports"). You will have to write lots of declares in OO Basic ...

If you want to go that way see http://www.oooforum.org/forum/viewtopic.phtml?t=66849 for interpreting the structures returned from / required by the dll calls

Good luck,

ms777
ms777
Volunteer
Posts: 177
Joined: Mon Oct 08, 2007 1:33 am

Re: Importing .OCX controls in vbscript

Post by ms777 »

have a try with http://user.services.openoffice.org/en/ ... 434#p43434 . If it works, it is much simplier ...
Post Reply