0

I know that this question has already been answered but the given solution doesn't work for me. The given solution is:

Dim oDoc As Object
Dim Path$
oDoc = ThisComponent
Path$ = oDoc.getURL()

Actually this returns an empty string ("") for me. Is there something I missed?

I'm on LibreOffice 4.3.1.2 on Kubuntu 12.04.

Thanks for your help!

dom_beau
  • 2,437
  • 3
  • 30
  • 59

3 Answers3

1

What happens if you run this?

If oDoc.HasLocation() Then
  Print "The Document URL is " & oDoc.getURL()
Else
  Print "The document has not yet been stored"
End If
Andrew
  • 816
  • 7
  • 15
0

It works perfectly if I compile the macro, it doesn't work if I debug the uncompiled macro.

dom_beau
  • 2,437
  • 3
  • 30
  • 59
0

of course, because the debug environment Parent is not the same then your Document Parent.