Bonjour je voulais écrire du HTML de WORd dans un fichier
exemple
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
<![CDATA[<table x:str="""" style=""border-collapse: collapse; width: 519pt;"" border=""5"" cellpadding=""0"" cellspacing=""0"" width=""691""><colgroup><col style=""width: 48pt;"" width=""64"">
<col style=""width: 89pt;"" width=""118"">
<col style=""width: 382pt;"" width=""509"">
</colgroup><tbody><tr style=""height: 44.25pt;"" height=""59"">
<td colspan=""4"" class=""xl67"" style=""height:27.0pt;
width:862pt"" align=""center"" height=""36"" width=""1149"">Déroulement du cas : actions à faire et résultat attendu pour
chaque étape</td>
</tr></table>]]>
Mon code est le suivant il marche avec du simple texte:
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
Dim oWord As Word.Application
        Dim oDoc As Word.Document
        Dim oTable As Word.Table
        Dim oPara1 As Word.Paragraph, oPara2 As Word.Paragraph
 
 
        'Start Word and open the document template.
        oWord = CreateObject("Word.Application")
        oWord.Visible = True
        oDoc = oWord.Documents.Add
 
        'Insert a paragraph at the beginning of the document.
        oPara1 = oDoc.Content.Paragraphs.Add
        oPara1.Range.Text = "testtest"
 
 
        oWord.ActiveDocument.Save()
        oWord.ActiveDocument.Close()
        oWord.Quit()
        Me.Close()