1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
Protected Sub GVAccueil_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs)
If (e.CommandName.Equals("OuvrirFichier")) Then
Dim path As String
Dim wordApp As New Word.Application
Dim WordDoc As New Word.Document
'On récupère le chemin du fichier
GVAccueil.SelectedIndex = e.CommandArgument
path = GVAccueil.SelectedRow.Cells(1).Text + ".doc"
'On ouvre Word
wordApp.Documents.Open(CType(path, Object))
WordDoc.Close(False)
wordApp.ShowMe()
wordApp.Visible = True
GVAccueil.SelectedIndex = -1
End If
End Sub |
Partager