Bonjour,
je voudrais importer des données, par VBA, présentes dans un document word. Pour cela j'utilise le code suivant, mais il me dit qu'une propriété ou la méthode n'est pas gérée par cet objet.
Le problème est que je n'arrive pas a récupérer le contenu d'une cellule d'un tableau word.
pouvez vous m'aider ?
merci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 Public Function ImportWord() Dim progword As Object Dim sPathFichierWord As String Dim TbWordTempo sPathFichierWord = "D:\Dev\Access\test.doc" Set progword = CreateObject("Word.Application") progword.Application.Visible = False progword.Documents.Open FileName:=sPathFichierWord Debug.Print progword.ActiveDocument.Table(0).cell(1, 1).Range.Text progword.Application.Quit Set progword = Nothing End Function
Partager