Bonjour,
je me suis créé une classe Confirmation ci dessous
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
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50 Private pGblAcc As String Private pCliName As String Private pCliAddress As String Private pCliLanguage As String Private pCliEmail As String '''''''''''''''''''''' 'properties '''''''''''''''''''''' Public Property Get GblAcc() As String GblAcc = pGblAcc End Property Public Property Let GblAcc(Value As String) pGblAcc = Value End Property Public Property Get CliName() As String pCliName = pCliName End Property Public Property Let CliName(Value As String) pCliName = Value End Property Public Property Get CliAddress() As String CliAddress = pCliAddress End Property Public Property Let CliAddress(Value As String) pCliAddress = Value End Property Public Property Get CliLanguage() As String CliLanguage = pCliLanguage End Property Public Property Let CliLanguage(Value As String) pCliLanguage = Value End Property Public Property Get CliEmail() As String CliEmail = pCliEmail End Property Public Property Let CliEmail(Value As String) pCliEmail = Value End Property Private Sub Confirmation_Initialize() End Sub
et lorsque je crér un nouvel objet et le passse en argument pour ne de mes fonction :
je me retrouve avec l'erreur :
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
22
23
24
25
26
27
28
29
30
31
32 Public Sub todo() Dim template As Confirmation Set template = New Confirmation template.GblAcc = GetFieldValue(tbClipboard.Text, "Global #", "Created") template.CliAddress = GetFieldValue(tbClipboard.Text, "Changed", "Sex") template.CliLanguage = GetFieldValue(tbClipboard.Text, "Language", "Currency") template.CliEmail = GetFieldValue(tbClipboard.Text, "E-Mail", "Agent") CreateDoc (template) Debug.Print S End Sub Public Sub CreateDoc(template As Confirmation) Dim MyWord As Word.Application Dim PathDocu As String Set MyWord = New Word.Application PathDocu = Constan.path With MyWord .Documents.Open (PathDocu) '.ActiveDocument.Bookmarks("date").Range.Text = & _ Format(Date, "dd mmmm yyyy") .ActiveDocument.Bookmarks("name").Range.Text = "12345" MsgBox (.ActiveDocument.Bookmarks("name").Range.Text) End With End Sub
Runtime error 438
Object doesn't support this property or method
Quelqu'un a une idée ?
Merci d'avance
Partager