【发布时间】:2011-04-05 11:19:02
【问题描述】:
我正在尝试将 Belkin 添加到我的 word 文档的标题中。
情况:
Excel: A1 = Belkin | Word: header needs to get Belkin
【问题讨论】:
我正在尝试将 Belkin 添加到我的 word 文档的标题中。
情况:
Excel: A1 = Belkin | Word: header needs to get Belkin
【问题讨论】:
这里有一个快速而肮脏的 Excel VBA 让你开始 - 创建一个新的 word 应用程序/word doc 并将 A1 的内容粘贴到标题中......
Sub CreateWordDocWithHeader()
Dim WApp As Word.Application
Dim WDoc As Word.Document
Dim WRng As Word.Range
Set WApp = New Word.Application
WApp.Visible = True
Set WDoc = WApp.Documents.Add
Set WRng = WDoc.Sections(1).Headers(wdHeaderFooterPrimary).Range
WRng = ActiveSheet.[A1]
Set WRng = Nothing
Set WDoc = Nothing
Set WApp = Nothing
End Sub
希望这会有所帮助....祝你好运
【讨论】: