betsamee Asterisk Zeperyl | La macro de ton document word:
Code :
- Sub AutoOpen()
- ActiveDocument.MailMerge.OpenDataSource Name:= _
- "chemin\tasource.mdb", _
- ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
- AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
- WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
- Format:=wdOpenFormatAuto, Connection:= _
- "Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=chemin\tasource.mdb;Mode=Read;Extended Properties="""";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Password=""""" _
- , SQLStatement:="SELECT * FROM `TaTable`", SQLStatement1:="", _
- SubType:=wdMergeSubTypeAccess
- CommandBars("Task Pane" ).Visible = False
- ActiveDocument.MailMerge.ViewMailMergeFieldCodes = wdToggle
- ...
|
Le code de ton bouton Generer:
Code :
- Dim oApp As Object
-
- 'NE PAS OUBLIER DANS TOOLS-->REFERENCES DE COCHER LES CASES
- '----------------------------------------MICROSOFT OFFICE 10.0 OBJECTS LIBRARY
- '----------------------------------------MICROSOFT WORD 10.0 OBJECTS LIBRARY
- Set oApp = CreateObject("Word.Application" )
- oApp.Visible = True
- oApp.Documents.Open ("chemindetondoc.doc" )
|
Message édité par betsamee le 30-06-2005 à 09:31:04
|