Please…How to print, via macro , a external write file (.odt)?
I’ve tried this macro code:
Sub GetCurrentFolder
GlobalScope.BasicLibraries.loadLibrary(“Tools”)
Dim sCurrentPath, sFile as string
Dim oProps(0) as new com.sun.star.beans.PropertyValue
sCurrentPath = DirectoryNameoutofPath(ThisComponent.getURL(),"/") & "/"
sFile = sCurrentPath & "SOMETHING_FILE.odt"
if FileExists(sFile) then
oProps(0).Name = "FileName"
oProps(0).Value = sFile
ThisComponent.print(oProps())
end if
End Sub
But nothing happens.