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
| Sub Import_doc()
Dim Wrd As Object
On Error Resume Next
NomFich = Application.GetOpenFilename("CCTSWL2009_T1, *.doc")
If Err <> 0 Or NomFich = False Then
End
End If
Feuil3.Range("A1") = NomFich
Set Wrd = CreateObject("word.Application")
Wrd.documents.Open (NomFich)
Wrd.Selection.WholeStory
Wrd.Selection.Copy
ThisWorkbook.Activate
Feuil3.Activate
Feuil3.Range("A2").Select
ActiveSheet.PasteSpecial Format:="Lien hypertexte", Link:=False, _
DisplayAsIcon:=False
Range("A1").Select
' Ferme Word en appliquant la méthode Quit sur l'objet Application.
Wrd.Application.Quit
Set Wrd = Nothing
End Sub |
Partager