I have the below 'dummy' sub assigned to a button on a switchboard document for my database. When clicked, it opens a document called "AddTransaction.odt", which contains some forms.
Code: Select all
Sub OpenAddTransDoc_
Globalscope.BasicLibraries.LoadLibrary( "MRILib" )
Dim DocProperties(2) As New com.sun.star.beans.PropertyValue
DocProperties(0).Name = "ReadOnly"
DocProperties(0).Value = True
DocProperties(1).Name = "Referer"
DocProperties(1).Value = ThisComponent.URL
DocProperties(2).Name = "MacroExecutionMode"
DocProperties(2).Value = 4
Dim DocURL As String
DocURL = ConvertToURL("F:\Mattias Durnez\Documents HDD\Business\Finances_database\frontend\forms\AddTransaction.odt")
ThisDoc = StarDesktop.loadComponentFromURL(DocURL,"_default",0,DocProperties)
MRI.InspectObj(ThisDoc)
End Sub
Code: Select all
Sub OpenDoc_
Globalscope.BasicLibraries.LoadLibrary( "MRILib" )
MRI.InspectObj(ThisComponent)
End Sub
I've used MRI to inspect the document's properties and can find the MacroExecutionMode and ReadOnly property through getArgs(). But nowhere can I seem to find the "Referer" property, even after manually stepping through all properties/methods in MRI. Usually I find my answer on this forum as a guest if such a thing happens, but this time my search came up empty. Would anyone be able to point me in the right direction? If not, are there other/better ways to find out if a document is being opened from a certain source?