Re: [api-dev] Embedding OOo into a VB application

2005-01-24 Thread Joachim Lingner
Hi,
 1) ActiveX

 By using OOo ActiveX component (so_activex.dll) it seems possible to
 embed OOo. The problem is that very few methods and properties are
 exposed and there is a lack of documentation about API on how interact
 with the component.
There is no type library and the IDispatch::GetTypeInfo is not supported 
as well. That is, you need dynamically invoke methods.
For C++ this means calle GetIDsOfNames before every Invoke.

 2) Office automation via COM

 We manage to create a Service Manager component representing OOo server
 which is possible to send commands for document manipulation. The
 problem is that every document is associated with its external window
 (not embedded).

 If it was possible to capture the window creation and to embed it into
 the form this will solve the problem
The com.sun.star.ServiceManager is an Exe - COM - component and there 
is no in-process handler DLL available.

 4) CLI-UNO Bridge

 We tried to use CLI-UNO bridge. There are 4 DLLs to reference into .NET
 project. Unfortunately the documentation it's not clear about what it's
 possible to do with the exposed namespaces and it's not clear if it is
 possible to create a Window object to be embed into a form.
 Even if it's seems very promising some substantial improvements are
 previewed for the 2.0 and this way could bring to write code not
 reusable with the new version.
The CLI-UNO Bridge for StarOffice 7 / OOo 1.1.x
is only a technology preview and is unsupported. I suggest to use OOo 
1.9.x to test out the bridge. Then the assemblies are automatically 
installed (if you have a .NET framework 1.1 installed), the office will 
be automatically started and there are probably some other improvements.
Unfortunately the Developer's Guide which contains updated information 
will take another couple of weeks until it is available on 
api.openoffice.org.

This probably does not solve your problems but maybe give you some hints.
Joachim
Hi all,
a friend on mine is trying to embed OOo 1.1.3 into a documentation 
management system developed in Visual Basic.

I state in advance I am not an expert and I'm investigating what is the 
best way to exploit.

It's problem is to open an OOo instance into a VB form in order to 
access documents in different format, to visualize document pages, to 
zoom into the content, to print and so on.
That is, he would like to access OOo services in Visual Basic as it is 
possible in C++.

He tried different ways that are ActiveX, COM, JavaBean as ActiveX 
control and CLI-UNO bridge. Each way has presented some problems.

1) ActiveX
By using OOo ActiveX component (so_activex.dll) it seems possible to 
embed OOo. The problem is that very few methods and properties are 
exposed and there is a lack of documentation about API on how interact 
with the component.

2) Office automation via COM
We manage to create a Service Manager component representing OOo server 
which is possible to send commands for document manipulation. The 
problem is that every document is associated with its external window 
(not embedded).

If it was possible to capture the window creation and to embed it into 
the form this will solve the problem

3) Javabean as ActiveX control
We managed to create a JavaBean containing an ActiveX and to register it 
as DLL (BasicOfficeBean.dll) which is possible, at design type, to 
integrate into a form.
When the program is executed, the ActiveX control is created correctly, 
but during OOo connection initialization phase, officebean.dll is not 
found.

BasicOfficeBean.setOfficeConnection(new LocalOfficeConnection());
public synchronized void setOfficeConnection(OfficeConnection aConn)
throws java.lang.IllegalStateException
{
...
   
// mConnection = NewLocalOfficeConnection();
mConnection = a Conn ;
mConnection.addEventListener(new ConnectionListener());
}

The bean initialitazion procedure tries to create a connection to the 
local server using the code in officebean.jar. This calls the function 
LocalOfficeConnection() and in its turn try to load officebean.dll into 
its contructor

public LocalOfficeConnection()
{
try
{
setUnoUrl( uno:pipe,name= + getPipeName() + 
;urp;StarOffice.Servicemanager);
}
catch ( java.net.MalformedURLException e )
{}
// load libofficebean.so/officebean.dll
String aSharedLibName = getProgramPath() + 
java.io.File.separator + System.mapLibraryName(OFFI_LIB_NAME);
System.load( a SharedLibName ) ;

// System.load(C:\\ooo1.1.3\\program\\officebean.dll);
Effectively installation directory of OOo is not found  so it's not 
possible to load the DLL. It seems that getProgramPath returns a void 
string.

4) CLI-UNO Bridge
We tried to use CLI-UNO bridge. There are 4 DLLs to reference into .NET 
project. Unfortunately the documentation it's not clear about what it's 
possible to do with the exposed namespaces and it's not clear if it is 

[api-dev] Enumerate selected lines in the DataBasebrowser

2005-01-24 Thread sos
Need some help (basic coded) to have acces to the different lines when this 
lines are manualy selected in the DataSourcebrowser.
So:
A user makes a multiple selection in the datasoursebrowser and then via a 
macro he need to passes the data, line per line, into textfields and 
saving the Writer document between every line.
Now how to do that via a classic connection to a datasourse but needs some 
sample code in basic to do the same thing with lines selected in the 
datasourcebrowser . In the archives i found also so Java code but do not 
now how to transled to basic.

Fernand

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] Embedding OOo into a VB application

2005-01-24 Thread Michael Hoennig
Hi Davide

 3) Javabean as ActiveX control
 
 We managed to create a JavaBean containing an ActiveX and to register it 
 as DLL (BasicOfficeBean.dll) which is possible, at design type, to 
 integrate into a form.
 When the program is executed, the ActiveX control is created correctly, 
 but during OOo connection initialization phase, officebean.dll is not found.

officebean.dll is included in the OOo installation an found by the bean by
- either looking one directory higher in the hierarchy than the jar
files refered by the CLASSPATH
- or by the findResource method of the ClassLoader.

Additionally in the version you are using, the OOo Java Bean is nothing
but an SDK example.  OOo 2.0 will be the first version with an official
OOoJavaBean.  But the search mechanism is basically the same.

Michael


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]