Creer tableaux Word depuis excel

damix

XLDnaute Nouveau
Bonjour,
En fait, j'ai un bouton qui devrait génèrer un document excel type.
Je souhaite créer un document word depuis excel. Mais je ne parviens pas à creer deux tableaux. En effet, les tableaux se créaient mais s'emboitent et en plus ne sont pas visibles.
Damien


Dim WordObj As Object
Dim ActiveDocument
On Error Resume Next
Set WordObj = CreateObject("Word.Application.8")
'Pour afficher Word
WordObj.Visible = True
'Ajoute un document
WordObj.Documents.Add

WordObj.Selection.Font.Name = "Helvetica"
WordObj.Selection.Font.Size = "16"
WordObj.Selection.Font.Color = RGB(0, 255, 0)
WordObj.Selection.typeparagraph
WordObj.Selection.TypeText "Guide d'animation de l'atelier de travail"
WordObj.Selection.typeparagraph
WordObj.Selection
WordObj.Selection.Tables().Add WordObj.Selection.Range, 4, 2

'on creer la structure du document un titre en rouge et deux tableau
WordObj.Selectiontypeparagraph
WordObj.Selectiontypeparagraph
WordObj.Selectiontypeparagraph
WordObj.Selectiontypeparagraph
WordObj.Selection.Font.Color = RGB(0, 0, 0)

WordObj.Selection.typeparagraph

WordObj.Selection.Tables().Add WordObj.Selection.Range, 4, 2






WordObj.Selection.typeparagraph
WordObj.Selection.Font.Name = "Helvetica"
WordObj.Selection.Font.Size = "6"
WordObj.Selection.TypeText "Respecter la chronologie pour mettre en mouvement l'équipe"
WordObj.Selection.typeparagraph
 

Discussions similaires

Statistiques des forums

Discussions
311 720
Messages
2 081 915
Membres
101 837
dernier inscrit
Ugo