Vba在word doc的页脚中插入文件名

时间:2017-07-25 21:11:50

标签: vba ms-word word-vba

这是我对页脚的代码,但是我需要为文件名插入一个字段。任何帮助都会很棒!

With wdapp.ActiveDocument.Sections(1).Footers(1).range.Paragraphs(1)
    .range.Text = "AA SERVICE COMPANY - Heating & Cooling" & vbCr & "550 ANTHONY TRAIL; NORTHBROOK, IL 60062" & vbCr & "Phone:"
    .range.InsertAfter vbCr & "Page "
    Set r = .range
    E = .range.End
    r.Start = E
    .range.Fields.Add r, wdFieldPage
    .range.InsertAfter " of "
    E = .range.End
    r.Start = E
    .range.Fields.Add r, wdFieldNumPages
    .Alignment = wdAlignParagraphRight
    End With

0 个答案:

没有答案