Option Strict Off
Public Class frmInforme
Public objIni As New Inicio.Iniciar.Inicio
Private Sub frmInforme_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
Dim oSM As Object = CreateObject("com.sun.star.ServiceManager")
Dim oFM As Object = oSM.createInstance("com.sun.star.frame.Desktop")
Dim oDoc As Object 'First objects from the API
Dim arg() As String
Dim sRuta As String = "file:///C:/Fincas/juntas/" & objIni.miFichero
If objIni.control = True Then 'Crear un documento
oDoc = oFM.loadComponentFromURL(sRuta, "_blank", 0, arg(0)) 'Save the doc
Dim oText As Object = oDoc.getText()
Dim oCursor As Object = oText.createTextCursor()
Else 'Abrir un documento existente
oDoc = oFM.loadComponentFromURL(sRuta, "_blank", 0, arg(0)) 'Save the doc
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Information, ToString)
End Try
End Sub
End Class