Bonjour/Bonsoir
Est-ce que c'est possible de rendre ce code exécutable en arriéré plan ? sans que l'utilisateur interviennent dans la démarche de fusion :
Mon code est le suivant :
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 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <script language="VBScript"> Set AppWord = CreateObject("Word.Application") AppWord.visible = True AppWord.DisplayAlerts = False Set ActiveDocument = AppWord.Documents.Open("C:\\fusion.doc") ActiveDocument.Activate ActiveDocument.MailMerge.OpenDataSource("C:\\test.xls") With ActiveDocument.MailMerge .Destination = wdSendToNewDocument .MailAsAttachment = False .MailAddressFieldName = "" .MailSubject = "" .SuppressBlankLines = True With .DataSource .FirstRecord = wdDefaultFirstRecord .LastRecord = wdDefaultLastRecord End With .PrintOut .SaveAs "C:\\LettreType.doc" .Save .close Execute True End With ActiveDocument.PrintOut ActiveDocument.SaveAs "C:\\LettreType.doc" ActiveDocument.Save ActiveDocument.close Execute True AppWord.Application.Quit </script> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title> </title> </head> <body> <div >test fusion word</div> </body> </html>
Merci d'avance
Partager