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]

Reply via email to