HI All,
I am looking for a method to automate the process of exporting and importing code libraries from a network source location. Following the dialog boxes manually is easy enough, but I will pretty much need to do it through code at some point. I've found the process to load libraries once they are imported, but haven't found the import functionality. Any pointers?
Thanks and have a great day.
Steve
[Solved] OObasic Macros to Import and Export Libraries
[Solved] OObasic Macros to Import and Export Libraries
Last edited by slang4201 on Thu Dec 04, 2008 11:11 pm, edited 1 time in total.
----------------
-Steve
OOo 3.1 on Ms Windows XP
-Steve
OOo 3.1 on Ms Windows XP
Re: OObasic Macros to Import and Export Libraries
OK, Part 1 I think is complete. To import a networked library location and make it active:
Now to figure out how to macroize export...
Steve
Code: Select all
Sub foo
test_LoadLibrary("lib_tectonics")
End Sub
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sub test_LoadLibrary(byval strLibName as string)
Dim oLib as object
Const cLibSourcePath as String = "Y:\D0097\oo_code_library\"
'add a link to the library referenced
With GlobalScope
.BasicLibraries.CreateLibraryLink(strLibName, convertToURL(cLibSourcePath & strLibName), False)
.BasicLibraries.LoadLibrary(strLibName)
End With
End Sub
Steve
----------------
-Steve
OOo 3.1 on Ms Windows XP
-Steve
OOo 3.1 on Ms Windows XP
Re: OObasic Macros to Import and Export Libraries
Store your code in a library other than "Standard". Get the organizer and export the librarie(s) as add-on. Installation should be a double-click then.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: OObasic Macros to Import and Export Libraries
@Villeroy - thanks for the suggestion.
I look at the Standard library the way I look at Normal.dot in the MS Word world... something to be avoided when possible from a code perspective. Other than a minimalist bootstrap script to load development and utility libraries, I don't see it being a repository for much else.
I hadn't explored the possibilities of an extension, since I am going to be loading and unloading libraries based on the document the user has open and active - behind the scenes - and avoid user interaction completely and it didn't seem to fit that bill. I may be wrong, though. (I am new to OOBasic).
A few of the things I am still looking to solve/discover:
1. a watcher that triggers every time the active document changes;
2. a way to embed a menu into a toolbar;
3. a way to change menus dynamically during run time.
It's always fun to learn a new environment!
Steve
I look at the Standard library the way I look at Normal.dot in the MS Word world... something to be avoided when possible from a code perspective. Other than a minimalist bootstrap script to load development and utility libraries, I don't see it being a repository for much else.
I hadn't explored the possibilities of an extension, since I am going to be loading and unloading libraries based on the document the user has open and active - behind the scenes - and avoid user interaction completely and it didn't seem to fit that bill. I may be wrong, though. (I am new to OOBasic).
A few of the things I am still looking to solve/discover:
1. a watcher that triggers every time the active document changes;
2. a way to embed a menu into a toolbar;
3. a way to change menus dynamically during run time.
It's always fun to learn a new environment!
Steve
----------------
-Steve
OOo 3.1 on Ms Windows XP
-Steve
OOo 3.1 on Ms Windows XP
Re: OObasic Macros to Import and Export Libraries
As far as I know this is not possible in Basic. You need an object oriented language to implement listeners and dispatch interceptors.1. a watcher that triggers every time the active document changes;
2. a way to embed a menu into a toolbar;
3. a way to change menus dynamically during run time.
Code: Select all
from com.sun.star.frame import XDispatchProviderInterceptor, \
XDispatchProviderInterception, XInterceptorInfo, XDispatchProvider, XDispat
ch, \
XNotifyingDispatch, XDispatchResultListener, XStatusListener
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: OObasic Macros to Import and Export Libraries
If anyone is tracking, I have solved the dynamic menus problem. Every time the active document changes I can have a specific menu commands appropriate to that document type available under a custom menu. Calling the thread solved.
----------------
-Steve
OOo 3.1 on Ms Windows XP
-Steve
OOo 3.1 on Ms Windows XP