各位朋友帮忙,谢谢

解决方案 »

  1.   

    'Excel中设置页眉字体及大小
    Private Sub Command2_Click()
        Dim xlApp As New excel.Application
        Dim xlBook  As excel.Workbook
        Dim xlSheet As excel.Worksheet
        
        xlApp.Caption = "test"
        Set xlBook = xlApp.Workbooks.Add
        Set xlSheet = xlBook.Worksheets(1)
        
        With xlApp.ActiveSheet.PageSetup
                .LeftHeader = "&""宋体,斜体""&10中国"
                .CenterHeader = ""
                .RightHeader = ""
                .LeftFooter = ""
                .CenterFooter = ""
                .RightFooter = ""
            End With
        xlApp.Visible = True
    End Sub
      

  2.   

    .CenterHeader = "&""宋体,加粗""&22中国"
      

  3.   

    加"&U"即可
    .CenterFooter = "&U文字"