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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
| Sub CreationEntete()
ActiveDocument.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.WholeStory
Selection.Delete
With ActiveDocument.PageSetup
.TopMargin = CentimetersToPoints(1.5)
.BottomMargin = CentimetersToPoints(1.5)
.LeftMargin = CentimetersToPoints(1.75)
.RightMargin = CentimetersToPoints(1.75)
.Gutter = CentimetersToPoints(0)
.HeaderDistance = CentimetersToPoints(0.8)
.FooterDistance = CentimetersToPoints(0.7)
.DifferentFirstPageHeaderFooter = False
End With
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=2, NumColumns:= _
3, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _
wdAutoFitFixed
With Selection.Cells(1)
.TopPadding = CentimetersToPoints(0)
.BottomPadding = CentimetersToPoints(0)
.LeftPadding = CentimetersToPoints(0.19)
.RightPadding = CentimetersToPoints(0.19)
.WordWrap = True
.FitText = False
End With
Selection.Tables(1).Cell(1, 1).Width = CentimetersToPoints(4.7)
Selection.Tables(1).Cell(1, 1).Height = CentimetersToPoints(1.8) '2.73
Selection.Tables(1).Cell(1, 2).Width = CentimetersToPoints(9.14)
Selection.Tables(1).Cell(1, 3).Width = CentimetersToPoints(4.7)
Selection.Tables(1).Cell(2, 3).Delete
Selection.Tables(1).Cell(2, 2).Delete
Selection.Tables(1).Cell(2, 1).Width = CentimetersToPoints(18.54)
Selection.Tables(1).Cell(2, 1).Height = CentimetersToPoints(0.24)
Selection.Tables(1).Cell(2, 1).Select
With Selection
.Font.Name = "Calibri"
.Font.Size = 5
.Text = "Ce document est propriété de xxx - yyy SA. Il ne peut être transmis, copié, utilisé ou exécuté par des tiers sans l'autorisation écrite de la Direction de xxx-yyy SA"
.Paragraphs.Alignment = wdAlignParagraphCenter
End With
Selection.Tables(1).Cell(1, 1).Select
Selection.InlineShapes.AddPicture FileName:= _
"R:\SMI\Nouveau-Logo-horizontal.PNG" _
, linkToFile:=False, saveWithDocument:=True
Selection.ParagraphFormat.SpaceBefore = 3
Selection.Font.Name = "Calibri"
Selection.Font.Size = 8
Selection.TypeParagraph
Selection.ParagraphFormat.TabStops.Add Position:=CentimetersToPoints(1.71), _
Alignment:=wdAlignTabLeft, Leader:=wdTabLeaderSpaces
Selection.ParagraphFormat.TabStops.Add Position:=CentimetersToPoints(3.5) _
, Alignment:=wdAlignTabLeft, Leader:=wdTabLeaderSpaces
Selection.TypeText Text:="Crée-par :"
Selection.TypeText Text:=vbTab & "18.12.11" & vbTab & "JPC"
Selection.TypeParagraph
Selection.ParagraphFormat.SpaceBefore = 0
Selection.TypeText Text:="Révisé-par :"
Selection.TypeText Text:=vbTab & "19.12.11" & vbTab & "ANC"
Selection.TypeParagraph
Selection.TypeText Text:="Validé-par :"
Selection.TypeText Text:=vbTab & "20.12.11" & vbTab & "ROA"
Selection.TypeParagraph
Selection.TypeText Text:="Distribué :"
Selection.TypeText Text:=vbTab & "ROA / ANC / JPC / FRS / ROA / FEV / SDF / QWE / XCV / ERW / QWE / XCV / ERW"
Selection.Tables(1).Cell(1, 2).Select
Selection.ParagraphFormat.TabStops.Add Position:=CentimetersToPoints(2.04), _
Alignment:=wdAlignTabCenter, Leader:=wdTabLeaderSpaces
Selection.ParagraphFormat.TabStops.Add Position:=CentimetersToPoints(6.3), _
Alignment:=wdAlignTabCenter, Leader:=wdTabLeaderSpaces
Selection.Font.Name = "Calibri"
Selection.Font.Size = 12
Selection.Font.Bold = wdToggle
Selection.TypeText Text:=vbTab & "Essais 1" & vbTab & "Essais 2"
Selection.TypeParagraph
Selection.TypeParagraph
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
Selection.TypeText Text:=vbTab & "Essais essais essais essais essais essais essais essais essais 3"
ActiveDocument.Sections(1).Headers(1).Range.Tables(1).Cell(1, 3).Range.ParagraphFormat.TabStops.Add _
Position:=CentimetersToPoints(0.8), Alignment:=wdAlignTabCenter, Leader:=wdTabLeaderSpaces
ActiveDocument.Sections(1).Headers(1).Range.Tables(1).Cell(1, 3).Range.ParagraphFormat.TabStops.Add _
Position:=CentimetersToPoints(1.8), Alignment:=wdAlignTabCenter, Leader:=wdTabLeaderSpaces
With ActiveDocument.Sections(1).Headers(1).Range.Tables(1).Cell(1, 3).Range
.Font.Name = "Calibri"
.Font.Size = 16
.Font.Bold = wdToggle
.Text = vbTab & "ASD" & vbTab & "Essais"
End With
ActiveDocument.Sections(1).Headers(1).Range.Tables(1).Cell(1, 3).Range.InlineShapes.AddPicture _
FileName:="R:\SMI\Logo Process critique (v3).jpg", linkToFile:=False, saveWithDocument:=True
With ActiveDocument.Sections(1).Headers(1).Range.Tables(1).Cell(1, 3).Range.InlineShapes(1)
.Height = 21
.Width = 36.75
.ConvertToShape
End With
With ActiveDocument.Sections(1).Headers(1).Shapes(1)
.Top = 1.6
.Left = 90
.ZOrder msoBringInFrontOfText
End With
End Sub |
Partager