1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| Imports Word = Microsoft.Office.Interop.Word
...
...
Public Sub PrintWord(ByVal WORD_NAME As String, ByVal Visible As Boolean)
If My.Computer.FileSystem.FileExists(WORD_NAME) Then ' Verifie si le fichier xls existe
Dim InstanceWord As New Word.Application
Dim Fichier As New Word.Document
Fichier = InstanceWord.Application.Documents.Open(WORD_NAME)
InstanceWord.Visible = True
Fichier.PrintPreview()
Else
MessageBox.Show("File does not find !", "Error Open Word", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End If
End Sub |
Partager