如何将多个文本框中的文字写入Word的页眉中
请教大家,如何将多个文本框中的文字写入Word的页眉中包含字体大小和行距
程序代码:
Private Sub Command1_Click()
Dim WordDoc As New Word.Application
WordDoc.Documents.Open "c:\1.doc" '打开一个存大的WORD文档
With WordDoc.ActiveWindow
If .View.SplitSpecial <> wdPaneNone Then
.Panes(2).Close
End If
If .ActivePane.View.Type = wdNormalView Or .ActivePane.View.Type = wdOutlineView Then
.ActivePane.View.Type = wdPrintView
End If
.ActivePane.View.SeekView = wdSeekCurrentPageHeader
.Selection.Font.Size = 18: .Selection.Font.Bold = True'这里是页眉的字号和粗体
.Selection.TypeText Text:=Text1.Text & Text2.Text '这里是你要插入的内容啦
.Selection.TypeParagraph
.Selection.TypeBackspace
.ActivePane.View.SeekView = wdSeekMainDocument
End With
WordDoc.Visible = True
End Sub
