I think the reason of your problem stem from unsaved document which doesn't have a path. As a result your pathName variable
value is only like this: "\Periodic Count\CaseManager_CSV.txt"
which is incorrect.
As you mentioned you want to save in the subfolder of the folder where your template is saved. Possibly you should modify pathName variable
in this way:
pathName = ActiveDocument.AttachedTemplate.Path & "\Periodic Count\CaseManager_CSV.txt"