Public Sub CreateWord()
Dim myword As Word.Application
Dim mydoc As New Word.Document
Set myword = New Word.Application
Set mydoc = .Documents.Add(Template:="D:\辦案專用\到案經過.dotx", Visible:=True)
mydoc.Sections.GoTo What:=wdGoToBookmark, Which:=wdGoToAbsolute, Name:="到案人1"
mydoc.Sections.TypeText (Text: = "Hello")
End Sub
新建模塊,想通過魔板,在模板的書簽處插入hello字樣,但為什么提示 無效不合法的參考。
uj5u.com熱心網友回復:
mydoc.Sections.TypeText (Text: = "Hello")
去掉括號改成
mydoc.Sections.TypeText Text: = "Hello"
試試
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/51405.html
標籤:VBA
上一篇:學校的一個基礎知識求解,感謝!
