Property or method not found: DocumentInfo

I am sure that this error message has been discussed here before, but I could not find anything relating to my current problem.

I have LO 4.1.4.2 installed in a box with the Debian Wheezy OS. I cannot assign a template to a document. Whenever I try, the message which forms the title of this post appears. I would be grateful if someone could me tell me whether this problem can be fixed and, if so, how.

Regards, Ken Heard

Hi Ken,

Ken Heard wrote (10-02-14 10:37)

I cannot assign a template to a document. Whenever I try, the message
which forms the title of this post appears.

This sounds as if you do something with Basic?
If so, in 4.0 there has been a change in the API.
See the release notes.
   https://wiki.documentfoundation.org/ReleaseNotes/4.0

And a little example below that may be helpful:

Regards,
Cor

  If HasUnoInterfaces(ThisComponent,
"com.sun.star.document.XDocumentInfoSupplier") Then
  ' 3.x
    oDocInfo = ThisComponent.getDocumentInfo()
    oDocSetInfo = oDocInfo.getPropertySetInfo
  Else
    oDocSetInfo =
ThisComponent.getDocumentProperties.getUserDefinedProperties.getPropertySetInfo
    oDocInfo = ThisComponent.getDocumentProperties.getUserDefinedProperties
  End If

   If oDocSetInfo.hasPropertyByName(sName) Then
    ReadMyDocProp = oDocInfo.getPropertyValue(sName)
  End If