View Single Post
The first problem is that you are not assigning oFolder to a folder object, you are assigning it to a string. Strings don't have the properties of an OF folder.

You will find examples of how to get a reference to a folder object in various code examples in this forum.

The second problem is that some tasks will return missing value as their context, and a missing value does not have a name property.

Just before you get to that line, you will need to test the context of each task, assigning an empty string to a variable if the tasks's context is a missing value, and the context name otherwise.