P
phil91
Guest
je dois récupérer à l'aide d'une macro les données d'un formulaire word
avec des signets. Cela fonctionne mais je n'arrive pas à lire le résultats des cases à cochers. je récupèrer des (carré) cochez ou pas.
comment puis je faire
Voici mon code
a = 1
Dim Wd As Word.Application
Set Wd = New Word.Application
With Wd
.Visible = False
.Documents.Open ("C:\inscription.doc")
z = ActiveDocument.Bookmarks.Count
.Selection.GoTo What:=wdGoToBookmark, Name:="Texte53"
num = .Selection.BookmarkID
Dim aMarks As Bookmark
Feuil1.Cells(a, 2) = .Selection.Text
a = a + 1
For i = z To 1 Step (-1)
Set myField = .Selection.NextField
If Not (myField Is Nothing) Then StatusBar = "Field found"
testar = .Selection.Text
Feuil1.Cells(a, 2) = .Selection.Text
a = a + 1
Next
.Quit False
End With
avec des signets. Cela fonctionne mais je n'arrive pas à lire le résultats des cases à cochers. je récupèrer des (carré) cochez ou pas.
comment puis je faire
Voici mon code
a = 1
Dim Wd As Word.Application
Set Wd = New Word.Application
With Wd
.Visible = False
.Documents.Open ("C:\inscription.doc")
z = ActiveDocument.Bookmarks.Count
.Selection.GoTo What:=wdGoToBookmark, Name:="Texte53"
num = .Selection.BookmarkID
Dim aMarks As Bookmark
Feuil1.Cells(a, 2) = .Selection.Text
a = a + 1
For i = z To 1 Step (-1)
Set myField = .Selection.NextField
If Not (myField Is Nothing) Then StatusBar = "Field found"
testar = .Selection.Text
Feuil1.Cells(a, 2) = .Selection.Text
a = a + 1
Next
.Quit False
End With