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
| For Each para In wrdDoc.Paragraphs
wrdApp.Selection.Paragraphs(1).Range.Select
' Retient sa couleur
Dim CoulRVB As Long
Dim Bleu As Integer
Dim Vert As Integer
Dim Rouge As Integer
CoulRVB = wrdApp.Selection.Font.Color
Rouge = Int(CoulRVB Mod 256)
Vert = Int((CoulRVB Mod 65536) / 256)
Bleu = Int(CoulRVB / 65536)
Dim valeur As String
valeur = wrdApp.Selection
valeur = Replace(Replace(Replace(Replace(Replace(Replace(Replace(wrdApp.Selection, Chr(11), " "), Chr(12), " "), Chr(1), " "), Chr(7), " "), Chr(9), " "), vbCr, " "), vbLf, " ")
REP.Sheets(1).Cells(m, 1).Value = valeur
REP.Sheets(1).Cells(m, 1).Font.Color = RGB(Rouge, Vert, Bleu)
REP.Sheets(1).Cells(m, 1).Font.Size = wrdApp.Selection.Font.Size
If wrdApp.Selection.Font.Bold = True Then
REP.Sheets(1).Cells(m, 1).Font.Bold = True
End If
If wrdApp.Selection.Font.Italic = True Then
REP.Sheets(1).Cells(m, 1).Font.Italic = True
End If
If wrdApp.Selection.Font.Underline = wdUnderlineSingle Then
REP.Sheets(1).Cells(m, 1).Font.Underline = xlUnderlineStyleSingle
End If
If wrdApp.Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Then
REP.Sheets(1).Cells(m, 1).HorizontalAlignment = xlHAlignCenter
End If
If wrdApp.Selection.ParagraphFormat.Alignment = wdAlignParagraphRight Then
REP.Sheets(1).Cells(m, 1).HorizontalAlignment = xlHAlignRight
End If
m = m + 1
wrdApp.Selection.MoveDown Unit:=wdParagraph, Count:=1 'descend d'un paragraphe
Next para |
Partager