TO FENGJUN兄: 以下代码的意思是设置文档的页眉: Sub Example()
With ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range
.Text = "xxx¹«Ë¾Îļþ ÎļþºÅ£ºB006-[2005]0902"
.Font.Bold = True
.Font.Name = "ËÎÌå"
.Font.Size = 11
.ParagraphFormat.Borders(wdBorderBottom).LineStyle = wdLineStyleSingle
End With
With ActiveDocument.PageSetup
.LeftMargin = Word.CentimetersToPoints(2.12)
.RightMargin = Word.CentimetersToPoints(2.12)
End With
End Sub
请把它加在 .SaveAs ThisDocument.Path & "\" & FilName 这句代码之前,并用NEWDOC代替ACTIVEDOCUMENT。 至于半条线,请在主文档中重新设置,设置段落下边框线更好,不要用空格和下划线,因为空格在换行过程中,有变化。 |