1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| Imports Microsoft.Office.Interop.Word
Public Class Form1
Dim UnFichier As String = "C:\Users\Clement Marcotte\Documents\Capturing Video from Web.docx"
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim Unfichier2 As String = UnFichier.Replace("docx", "rtf")
Dim AppWord As New Microsoft.Office.Interop.Word.Application
AppWord.Visible = False
Dim UnDocument As Microsoft.Office.Interop.Word.Document = AppWord.Documents.Open(UnFichier)
UnDocument.SaveAs2(Unfichier2, 6)
UnDocument.Close()
UnDocument = Nothing
AppWord.Quit()
RichTextBox1.LoadFile(Unfichier2)
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim AppWord As New Microsoft.Office.Interop.Word.Application
AppWord.Visible = False
Dim UnDocument As Microsoft.Office.Interop.Word.Document = AppWord.Documents.Open(UnFichier)
Dim UneSélection As Microsoft.Office.Interop.Word.Selection = UnDocument.Windows.Item(1).Selection
UneSélection.WholeStory()
UneSélection.Copy()
RichTextBox1.Paste()
UnDocument.Close()
UnDocument = Nothing
AppWord.Quit()
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Me.Dispose()
End Sub
End Class |
Partager