Re: [api-dev] How to load basicLibrary (with API and BASIC)from rempote OO- document

2008-11-07 Thread Fernand Vanrie
I found on the forum also working code to link to Basiclibraries stored 
outside a doc but with a troubling comment from the author :
I was also having trouble packing  repacking the macros into the 
document (they have to be outside the document to be CVS diff'd) ???


do that mean that there can not been linked (with the API) to libraries 
stored in a Document ?


Function AddLinkToBasicLibrary(srcnames) As Boolean
' TODO: check if libraries already exist and ask user if they want to 
replace them.

   oLib = GlobalScope.BasicLibraries
   oPath = CurrentPath + / '/PlantillasSP/ 'This path links to the 
directory where the add-on directories are stored.

   oLinkedLibs = srcnames
   libType = library ' just for queryUser

   for iLib = 1 to 2 ' this makes two passes, one for the dialogues and 
one for the macros

  for j = 0 to ubound(oLinkedLibs) ' loop through each lib
 if (oLib.hasByName(oLinkedLibs(j)) = false) then
result = oLib.createLibraryLink(oLinkedLibs(j), 
convertToUrl(oPath+oLinkedLibs(j)), false)

 else ' already exists, ask user if they want to overwrite
if (queryUser(sAddLinkToBasicLibraryExist + ( + 
oLinkedLibs(j) + sAddLinkToBasicLibraryOverwrite, 
sAddLinkToBasicLibraryNotOverwrite+libType+ ( + oLinkedLibs(j) + ))) 
then

   oLib.removeLibrary(oLinkedLibs(j))
   result = oLib.createLibraryLink(oLinkedLibs(j), 
convertToUrl(oPath+oLinkedLibs(j)), false)

endif
 endif

 ' Check again to make sure we linked it correctly
 if (oLib.hasByName(oLinkedLibs(j)) = false) then
msgbox sAddLinkToBasicLibraryIstallFailed + oLinkedLibs(j) 
+ '.

exit function
 endif
  next j
  oLib = GlobalScope.DialogLibraries
  libType = dialog
   next iLib

   AddLinkToBasicLibrary = true
End Function





Fernand


Thanks for any hint

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




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



Re: [api-dev] How to load basicLibrary (with API and BASIC)from rempote OO- document

2008-11-06 Thread Fernand Vanrie

Fernand Vanrie wrote:

Hallo all,

I kwow how to create a new BasicLibrary based on the modules in others 
libraries  present in the globalsscope or in a document  already 
opened in the desktop. With the GUI we can simply imoport a complete 
library prssent in a remote OO-document. Can this imoport also been 
done with the API en some basic code lines ?


OK: found a glimp of hope in the  createLibraryLink method who is 
supported by a librarycontainer


it supposes to worke like:

oliblink= 
basicLibraries.createLibraryLink(Standard,converttoURL(c:\testfile.odt),false)


here I run in a Error  loadingBASIC of document 
file:///c:Testfile.odt/script.xlb/:

General Error
 Genral input/output error
the testfile.odt is present, and can be loaded  from the API and 
contained a Standard basic library


any  ideas ???
Fernand


Thanks for any hint

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



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