Bug 63298

Summary: : Windows WSH Automation error with method .getDocumentInfo()
Product: LibreOffice Reporter: fremdling
Component: LibreOfficeAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED NOTABUG    
Severity: normal CC: gerard.fargeot
Priority: medium Keywords: regression
Version: 4.0.2.2 release   
Hardware: Other   
OS: Windows (All)   
Whiteboard: BSA
Crash report or crash signature: Regression By:

Description fremdling 2013-04-09 07:51:32 UTC
Problem description: 
We use WSH scripts for automation.
Before LO update prior 4.0 from 3.6 everything was fine.
But now it is not. 
Error occurs when method getDocumentInfo() is called.

Simplified Script:
<pre>
set fso=CreateObject("Scripting.FileSystemObject")
Set objServiceManager = CreateObject("com.sun.star.ServiceManager")
Set Stardesktop = objServiceManager.createInstance("com.sun.star.frame.Desktop")
Set dispatcher = objServiceManager.createInstance("com.sun.star.frame.DispatchHelper")
Set V = objServiceManager.Bridge_GetStruct("com.sun.star.beans.PropertyValue")
path=fso.GetFolder(".\templates\").Path&"\"
Set doc = Stardesktop.loadComponentFromURL("file:///"&path&"RightWay.dot", "_blank", 0, Array(V))
Set oText = doc.getText()
Set DocI=doc.getDocumentInfo()
call doc.LockControllers
call DocI.setPropertyValue("f2ADRU","test")
doc.getTextFields.refresh()
</pre>

Script receives error:
Windows Script host
Unsupported method or property 'getDocumentInfo'
Error: 800A01B6
So, some how LO 4 cannot call:
Set DocI=doc.getDocumentInfo()


Current behavior:
Error occurs.

Expected behavior:
Everything must be smooth, like in LO 3.6 :)

              
Operating System: Windows XP
Version: 4.0.2.2 release
Last worked in: 3.6.2.2 release
Comment 1 GerardF 2013-04-09 09:30:36 UTC
There is change in the API. XDocumentInfo is removed.
Look at releases notes for 4.0 :
https://wiki.documentfoundation.org/ReleaseNotes/4.0#API_Changes