Bonjour à tous,
Je suis nouveau sur ce forum, j'ai une question concernant la fabrication d'une macro.
j'ouvre un fichier HTML avec Word, je voudrais
- Passer en mode page
- Mettre les marges au minimum
- Insérer un pied de page avec du texte
j'ai donc lancé l'enregistrement de la macro, pas de soucis pour les deux premiers points, mais pour l'insertion du pied de page, j'ai un cadre au milieu de la page et un mode dessin !!
je ne sais pas ou chercher ?
Merci pour vos lumières
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
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43 Sub EASY() ' ' EASY Macro ' ' If ActiveWindow.View.SplitSpecial = wdPaneNone Then ActiveWindow.ActivePane.View.Type = wdPrintView Else ActiveWindow.View.Type = wdPrintView End If With Selection.PageSetup .LineNumbering.Active = False .Orientation = wdOrientPortrait .TopMargin = CentimetersToPoints(1.27) .BottomMargin = CentimetersToPoints(1.27) .LeftMargin = CentimetersToPoints(1.27) .RightMargin = CentimetersToPoints(1.27) .Gutter = CentimetersToPoints(0) .HeaderDistance = CentimetersToPoints(1.25) .FooterDistance = CentimetersToPoints(1.25) .PageWidth = CentimetersToPoints(21) .PageHeight = CentimetersToPoints(29.7) .FirstPageTray = wdPrinterDefaultBin .OtherPagesTray = wdPrinterDefaultBin .SectionStart = wdSectionNewPage .OddAndEvenPagesHeaderFooter = False .DifferentFirstPageHeaderFooter = False .VerticalAlignment = wdAlignVerticalTop .SuppressEndnotes = False .MirrorMargins = False .TwoPagesOnOne = False .BookFoldPrinting = False .BookFoldRevPrinting = False .BookFoldPrintingSheets = 1 .GutterPos = wdGutterPosLeft End With Application.Templates( _ "C:\Users\Eric\AppData\Roaming\Microsoft\Document Building Blocks\1036\14\Built-In Building Blocks.dotx" _ ).BuildingBlockEntries("Alphabet").Insert Where:=Selection.Range, _ RichText:=True Selection.TypeBackspace ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument End Sub
Partager