Hi, we just upgraded from LibreOffice 5 to 6 and we’re now getting an error with one of our custom macros.
I didn’t write this code, so I don’t know much about it, but would appreciate any help.
Here’s the function:
' get the long name of the internal draft image
' if it isn't already embedded, do that first
function getDraftImage(oDoc as Object) as string
dim imageSource as string, imageName as string
dim imageURL
imageName = "draftImage.emf"
imageSource = "O:\FORMS\TMaOOoGlobal\"
oDoc = ThisComponent
Dim oBitmaps
oBitmaps = oDoc.createInstance( "com.sun.star.drawing.BitmapTable" )
if oBitmaps.hasByName(imageName) then
' it already exists, just get the long name
getDraftImage = oBitmaps.getByName(imageName)
else
' insert it and return the new long name
imageSource = imageSource & imageName
imageURL = convertToUrl(imageSource)
getDraftImage = LoadGraphicIntoDocument( oDoc, imageUrl, imageName )
end if
end function
And the error is occurring on this line:
getDraftImage = oBitmaps.getByName(imageName)