If you could move the content encoding up outside the each loop so it only happens once, I'll merge this. Thanks so much for looking into this. We may need to change this so that the document gets encoded so that it's also encoded for the substitution, but until I get back to my computer this totally works! :thumbsup: