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 Word = Microsoft.Office.Interop.Word
Public Class Form1
Dim oWord As Word.Application
Dim oDoc As Word.Document
'Start word and open the document template
oWord = CreateObject("Word.Application")
oWord.Visible = True
'Open a document
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Process.Start("C:\Utilisateurs\lculot\Exemple.docx")
End Sub
'Convert .docx to .doc
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
End Sub
'Replace a bookmark
Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
oDoc = oWord.Document.Add
oWord.Documents.Add("C:\Cartolink Desktop\Urbanisme\Templates\Avis\AvisAgric.dot")
oDoc.Bookmarks.Item("INITIALES").Range.Text = "LC"
End Sub
'All done. Close this form
Me.Close()
End Class |
Partager