Just playing around here, but I can't get the For Each loop in the code below to work.

There is no error message. The $wd.Templates.Count prints 6, which is correct. It just won't print the name of the 6 templates.

Any ideas? Thanks in advance.

code:

break on

$wd = CreateObject("Word.Application")

? $wd.Templates.Count

For Each $template In $wd.Templates
? $template.Name
Next

sleep 5

$wd.quit(0)

exit