G
George Lee
The following code works in Office 2007 but not in Word 2007
Sub UpdateTables()
Dim myTOC As TableofContents
For Each myTOC In ActiveDocument.TablesOfContents
myTOC.Update
Next toc
End Sub
Specifically returning the error: A module is not a valid type. This error
is type of using a variable name that is the same as a module name. This is
not the case here. I can change the code to:
Sub UpdateTables()
Dim myTOC As object
For Each myTOC In ActiveDocument.TablesOfContents
myTOC.Update
Next toc
End Sub
This works fine but I lose my Intellisense in the compiler.
Anyone know why this is getting an error?
Sub UpdateTables()
Dim myTOC As TableofContents
For Each myTOC In ActiveDocument.TablesOfContents
myTOC.Update
Next toc
End Sub
Specifically returning the error: A module is not a valid type. This error
is type of using a variable name that is the same as a module name. This is
not the case here. I can change the code to:
Sub UpdateTables()
Dim myTOC As object
For Each myTOC In ActiveDocument.TablesOfContents
myTOC.Update
Next toc
End Sub
This works fine but I lose my Intellisense in the compiler.
Anyone know why this is getting an error?