On Thu, Jun 26, 2014 at 02:58:18PM +0100, Amenel VOGLOZIN wrote: > Hi all, > > Alexandro, I had spotted the XDocumentProperties interface. I had seen > it's meant to provide document properties but I had put it aside until > I could get event notifications sorted out.
If you only want two (when a document is opened and closed), then you should go for the css.task.Job, a global document event listener is an overhead as it will listen to every event for every document. > In that interface, there are only 2 suitable methods to read (or > "load") properties: loadFromStorage and loadFromMedium. Both of these > have [in] parameters only and both return void... So I'm wondering, > how is the client code supposed to retrieve the value of say, the > ModifiedBy attribute? > Therefore, as is, the call to loadFromMedium has no effect as far as > my client code is concerned. I'm back to square one. Don't use that, the document model implements http://www.openoffice.org/api/docs/common/ref/com/sun/star/document/XDocumentPropertiesSupplier.html and this gives direct access to the interface's attributes, just use the getters to retrieve the information. > To sum up, I just want to sysout a property (e.g. the original author) > of a document but I don't succeed in getting that information in > a variable. In Basic: author = ThisComponent.getDocumentProperties().Author MsgBox author Regards -- Ariel Constenla-Haile La Plata, Argentina
signature.asc
Description: Digital signature