我不明白为什么下面的函数会返回"Nothing“
Public Function generatsTOC(ByRef doc As Word.Document) As Word.TableOfContents
Dim toc As Word.TableOfContents
Set toc = doc.TablesOfContents.Add(range:=doc.range(0, 0), UseHyperlinks:=True, _
UseFields:=False, UseHeadingStyles:=True, _
UpperHeadingLevel:=1, LowerHeadingLevel:=4, IncludePageNumbers:=True, _
RightAlignPageNumbers:=True)
Set generatesTOC = toc
End Function下一节课..。
dim itoc as word.TableOfContents
dim tcg as TableOfContentsGenerator
set tcg = new TableOfContentsGenerator
Set itoc = tcg.generatsTOC(doc)当我看itoc时,它是NOTHING。
我不明白它是怎么不工作的?
发布于 2011-07-18 13:39:15
这是地球上最愚蠢的错误。我通过更正generatsTOC >>>> generatesTOC的拼写解决了这个问题
https://stackoverflow.com/questions/6694806
复制相似问题