Realizando una aplicación que interactúa con documentos de office en vb.net me sale el siguiente error 1053

'Dim WordApp As Word.ApplicationClass = Nothing
                'Dim WordApp As Word.Application = Nothing
                Dim wordApp As Microsoft.Office.Interop.Word.Application = New Microsoft.Office.Interop.Word.Application
                Dim texto As String = ""
                Dim wordDoc As Word.Document
                Try
                    DespMsg("1")
                    'WordApp = New Word.Application()
                    DespMsg("1.5 " & TypeName(WordApp))
                    WordApp.Visible = True
                    DespMsg("2")
                    'wordDoc = WordApp.Documents.Open(Label1.Text, True, True, False)
                    wordDoc = WordApp.Documents.Add(Label1.Text, True, True, False)
                    DespMsg("3")
                    wordDoc.Select()
                    texto = WordApp.Selection.Text
                    MsgBox("pause", MsgBoxStyle.Exclamation)
                    'Texto = Left(Texto, Len(Texto) - 1)
                    RichTextBox1.Text = texto
                    wordDoc.Close(False)
                Catch ex As Exception
                    DespMsg("4")
                    DespMsg(ex.Message)
                Finally
                    DespMsg("5")
                    wordDoc = Nothing
                    System.Threading.Thread.CurrentThread.CurrentCulture = oldCI
                    WordApp = Nothing
                End Try

0

Añade tu respuesta

Haz clic para o