1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| Sub ouvrir()
Dim WApp As Word.Application
Dim WDoc As Word.Document
doca = "R" & ActiveCell.Value
Set WApp = CreateObject("Word.Application")
Set WDoc = WApp.Documents.Open("D:\acrf\docacrf\" & doca & ".docx")
da = "ACRF cours de cuisine Madame Claudine Martin " & MonthName(Month(ActiveCell.Offset(0, 4).Value)) & " " & Year(ActiveCell.Offset(0, 4).Value)
With WDoc.Sections(1)
.Footers(wdHeaderFooterPrimary).Range.Text = da
.Footers(wdHeaderFooterPrimary).Range.Paragraphs.Alignment = wdAlignParagraphCenter
End With
Range("A1").Select
WApp.Visible = True
WApp.WindowState = wdWindowStateMaximize
WApp.Activate
WDoc.Activate
End Sub |
Partager