kalagara General User

Joined: 10 Mar 2010 Posts: 8
|
Posted: Mon Mar 15, 2010 7:47 am Post subject: Writng text to Word giving problem |
|
|
I'm trying to use OpenOffice 3.1 for Opening the Office Word template as well as modifying it dynamically with Database fields information at the time of opening the document from my harddisk storage location.
But the problem is Bootstrap.biitstrap() hanging and allowing to execute next lines.
Code Snippet:
Dim objDocument As Object
Dim FileNameSource As String = "C:\SysReports\FaceSheet.doc"
Dim localContext As XComponentContext
Dim sUnoIni As String = "file:///C:/Program Files/OpenOffice.org 3/URE/bin/uno.ini"
localContext = Bootstrap.biitstrap()
Dim objServiceManager As unoidl.com.sun.star.lang.XMultiServiceFactory
objServiceManager = CType(localContext.getServiceManager(), XMultiServiceFactory)
Dim objDesktop As XComponentLoader
objDesktop = CType(objServiceManager.createInstance("com.sun.star.frame.Desktop"), XComponentLoader)
Dim openProps As PropertyValue() = New PropertyValue(0) {}
openProps(0) = New PropertyValue()
openProps(0).Name = "Hidden"
openProps(0).Value = New uno.Any(True)
Dim objDocument As XComponent
objDocument = objDesktop.loadComponentFromURL(PathConverter(FileNameSource), "_default", 0, openProps) //Throwing Error from here
Plz help me to resolve this |
|